mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
Readoutflags (#61)
* WIP * eiger binary back wih versioning * fixed readout flag in ctbgui, added speedLevel enum * ctbgui: fixed a print out error * ctb readout bug fix * WIP * WIP * WIP
This commit is contained in:
parent
221bb65c0e
commit
5bcde789ac
@ -766,7 +766,7 @@ void ctbAcquisition::canvasClicked() {
|
|||||||
void ctbAcquisition::setCanvas(TCanvas* c) {
|
void ctbAcquisition::setCanvas(TCanvas* c) {
|
||||||
myCanvas=c;
|
myCanvas=c;
|
||||||
myCanvas->cd();
|
myCanvas->cd();
|
||||||
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)0x%p)->canvasClicked()",this));
|
myCanvas->AddExec("dynamic",Form("((ctbAcquisition*)%p)->canvasClicked()",this));
|
||||||
// myCanvas->AddExec("ex","canvasClicked()");
|
// myCanvas->AddExec("ex","canvasClicked()");
|
||||||
}
|
}
|
||||||
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
|
void ctbAcquisition::dataCallback(detectorData *data, long unsigned int index, unsigned int dum, void* pArgs) {
|
||||||
@ -1503,7 +1503,7 @@ void ctbAcquisition::update() {
|
|||||||
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::update")
|
} CATCH_DISPLAY ("Could not get number of digital samples", "ctbAcquisition::update")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
roMode = myDet->getReadoutMode().tsquash("Different values");
|
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||||
setReadoutMode(roMode);
|
setReadoutMode(roMode);
|
||||||
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::update")
|
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::update")
|
||||||
|
|
||||||
@ -1615,7 +1615,7 @@ void ctbAcquisition::toggleAcquisition() {
|
|||||||
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get receiver dbit offset", "ctbAcquisition::toggleAcquisition")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
roMode = myDet->getReadoutMode().tsquash("Different values");
|
roMode = static_cast<int>(myDet->getReadoutMode().tsquash("Different values"));
|
||||||
setReadoutMode(roMode);
|
setReadoutMode(roMode);
|
||||||
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::toggleAcquisition")
|
} CATCH_DISPLAY ("Could not get readout mode", "ctbAcquisition::toggleAcquisition")
|
||||||
|
|
||||||
@ -1798,11 +1798,11 @@ void ctbAcquisition::setDigitalSamples(int n) {
|
|||||||
void ctbAcquisition::setReadoutMode(int f) {
|
void ctbAcquisition::setReadoutMode(int f) {
|
||||||
|
|
||||||
roMode=f;
|
roMode=f;
|
||||||
slsDetectorDefs::readOutFlags flags=(slsDetectorDefs::readOutFlags)f;
|
slsDetectorDefs::readoutMode flag=(slsDetectorDefs::readoutMode)f;
|
||||||
if (flags&slsDetectorDefs::DIGITAL_ONLY) {
|
if (flag == slsDetectorDefs::DIGITAL_ONLY) {
|
||||||
nAnalogSamples=0;
|
nAnalogSamples=0;
|
||||||
adclist.clear();
|
adclist.clear();
|
||||||
} else if (flags&slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
} else if (flag ==slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1011,19 +1011,19 @@ void ctbPattern::setDigitalSamples() {
|
|||||||
|
|
||||||
void ctbPattern::setReadoutMode(Bool_t) {
|
void ctbPattern::setReadoutMode(Bool_t) {
|
||||||
try {
|
try {
|
||||||
int flags = 0;
|
slsDetectorDefs::readoutMode flag = slsDetectorDefs::ANALOG_ONLY;
|
||||||
if (cbAnalog->IsOn() && cbDigital->IsOn())
|
if (cbAnalog->IsOn() && cbDigital->IsOn())
|
||||||
flags=2;
|
flag=slsDetectorDefs::ANALOG_AND_DIGITAL;
|
||||||
else if (~cbAnalog->IsOn() && cbDigital->IsOn())
|
else if (~cbAnalog->IsOn() && cbDigital->IsOn())
|
||||||
flags=1;
|
flag=slsDetectorDefs::DIGITAL_ONLY;
|
||||||
else if (cbAnalog->IsOn() && ~cbDigital->IsOn())
|
else if (cbAnalog->IsOn() && ~cbDigital->IsOn())
|
||||||
flags=0;
|
flag=slsDetectorDefs::ANALOG_ONLY;
|
||||||
else {
|
else {
|
||||||
throw runtime_error("unkown readout flag");
|
throw runtime_error("unkown readout flag");
|
||||||
}
|
}
|
||||||
myDet->setReadoutMode(flags);
|
myDet->setReadoutMode(flag);
|
||||||
cout << "Set readout flags: " << flags << endl;
|
cout << "Set readout flag: " << flag << endl;
|
||||||
} CATCH_DISPLAY ("Could not set readout flags", "ctbPattern::setReadoutMode")
|
} CATCH_DISPLAY ("Could not set readout flag", "ctbPattern::setReadoutMode")
|
||||||
|
|
||||||
getReadoutMode();
|
getReadoutMode();
|
||||||
}
|
}
|
||||||
@ -1037,17 +1037,17 @@ int ctbPattern::getReadoutMode() {
|
|||||||
try{
|
try{
|
||||||
auto retval = myDet->getReadoutMode().tsquash("Different values");
|
auto retval = myDet->getReadoutMode().tsquash("Different values");
|
||||||
switch(retval) {
|
switch(retval) {
|
||||||
case 2:
|
case slsDetectorDefs::ANALOG_AND_DIGITAL:
|
||||||
cout << "analog and digital" << endl;
|
cout << "analog and digital" << endl;
|
||||||
cbAnalog->SetOn(kTRUE);
|
cbAnalog->SetOn(kTRUE);
|
||||||
cbDigital->SetOn(kTRUE);
|
cbDigital->SetOn(kTRUE);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case slsDetectorDefs::DIGITAL_ONLY:
|
||||||
cout << "digital only" << endl;
|
cout << "digital only" << endl;
|
||||||
cbAnalog->SetOn(kFALSE);
|
cbAnalog->SetOn(kFALSE);
|
||||||
cbDigital->SetOn(kTRUE);
|
cbDigital->SetOn(kTRUE);
|
||||||
break;
|
break;
|
||||||
case 0:
|
case slsDetectorDefs::ANALOG_ONLY:
|
||||||
cout << "analog only" << endl;
|
cout << "analog only" << endl;
|
||||||
cbAnalog->SetOn(kTRUE);
|
cbAnalog->SetOn(kTRUE);
|
||||||
cbDigital->SetOn(kFALSE);
|
cbDigital->SetOn(kFALSE);
|
||||||
@ -1055,7 +1055,7 @@ int ctbPattern::getReadoutMode() {
|
|||||||
default:
|
default:
|
||||||
throw("unknown readout flag");
|
throw("unknown readout flag");
|
||||||
}
|
}
|
||||||
Emit("readoutModeChanged(int)",retval);
|
Emit("readoutModeChanged(int)",static_cast<int>(retval));
|
||||||
return retval;
|
return retval;
|
||||||
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
} CATCH_DISPLAY ("Could not get readout flags", "ctbPattern::getReadoutMode")
|
||||||
|
|
||||||
|
@ -41,13 +41,6 @@ public:
|
|||||||
sls::Detector *det;
|
sls::Detector *det;
|
||||||
// Button group for radiobuttons for rate
|
// Button group for radiobuttons for rate
|
||||||
QButtonGroup *btnGroupRate;
|
QButtonGroup *btnGroupRate;
|
||||||
// enum for the Eiger clock divider
|
|
||||||
enum {
|
|
||||||
FULLSPEED,
|
|
||||||
HALFSPEED,
|
|
||||||
QUARTERSPEED,
|
|
||||||
NUMBEROFSPEEDS
|
|
||||||
};
|
|
||||||
// enum for the Eiger Parallel flag
|
// enum for the Eiger Parallel flag
|
||||||
enum {
|
enum {
|
||||||
PARALLEL,
|
PARALLEL,
|
||||||
|
@ -283,16 +283,8 @@ void qTabDataOutput::GetSpeed() {
|
|||||||
FILE_LOG(logDEBUG) << "Getting Speed";
|
FILE_LOG(logDEBUG) << "Getting Speed";
|
||||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
||||||
try {
|
try {
|
||||||
int retval = det->getSpeed().tsquash("Speed is inconsistent for all detectors.");
|
auto retval = det->getSpeed().tsquash("Speed is inconsistent for all detectors.");
|
||||||
switch(retval) {
|
comboEigerClkDivider->setCurrentIndex(static_cast<int>(retval));
|
||||||
case FULLSPEED:
|
|
||||||
case HALFSPEED:
|
|
||||||
case QUARTERSPEED:
|
|
||||||
comboEigerClkDivider->setCurrentIndex(retval);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw sls::RuntimeError(std::string("Unknown speed: ") + std::to_string(retval));
|
|
||||||
}
|
|
||||||
} CATCH_DISPLAY ("Could not get speed.", "qTabDataOutput::GetSpeed")
|
} CATCH_DISPLAY ("Could not get speed.", "qTabDataOutput::GetSpeed")
|
||||||
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
connect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this, SLOT(SetSpeed(int)));
|
||||||
}
|
}
|
||||||
@ -300,7 +292,7 @@ void qTabDataOutput::GetSpeed() {
|
|||||||
void qTabDataOutput::SetSpeed(int speed) {
|
void qTabDataOutput::SetSpeed(int speed) {
|
||||||
FILE_LOG(logINFO) << "Setting Speed to " << comboEigerClkDivider->currentText().toAscii().data();;
|
FILE_LOG(logINFO) << "Setting Speed to " << comboEigerClkDivider->currentText().toAscii().data();;
|
||||||
try {
|
try {
|
||||||
det->setSpeed(speed);
|
det->setSpeed(static_cast<slsDetectorDefs::speedLevel>(speed));
|
||||||
} CATCH_HANDLE ("Could not set speed.", "qTabDataOutput::SetSpeed", this, &qTabDataOutput::GetSpeed)
|
} CATCH_HANDLE ("Could not set speed.", "qTabDataOutput::SetSpeed", this, &qTabDataOutput::GetSpeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +306,7 @@ void qTabDataOutput::GetFlags() {
|
|||||||
comboEigerParallelFlag->setCurrentIndex(PARALLEL);
|
comboEigerParallelFlag->setCurrentIndex(PARALLEL);
|
||||||
else
|
else
|
||||||
comboEigerParallelFlag->setCurrentIndex(NONPARALLEL);
|
comboEigerParallelFlag->setCurrentIndex(NONPARALLEL);
|
||||||
} CATCH_DISPLAY ("Could not get speed.", "qTabDataOutput::GetSpeed")
|
} CATCH_DISPLAY ("Could not get flags.", "qTabDataOutput::GetFlags")
|
||||||
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
connect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this, SLOT(SetFlags()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
@ -563,7 +563,7 @@ void setupDetector() {
|
|||||||
setTimer(FRAME_PERIOD, DEFAULT_PERIOD);
|
setTimer(FRAME_PERIOD, DEFAULT_PERIOD);
|
||||||
setTimer(DELAY_AFTER_TRIGGER, DEFAULT_DELAY);
|
setTimer(DELAY_AFTER_TRIGGER, DEFAULT_DELAY);
|
||||||
setTiming(DEFAULT_TIMING_MODE);
|
setTiming(DEFAULT_TIMING_MODE);
|
||||||
setReadOutFlags(NORMAL_READOUT);
|
setReadoutMode(ANALOG_ONLY);
|
||||||
|
|
||||||
// enable all ADC channels
|
// enable all ADC channels
|
||||||
setADCEnableMask(BIT_32_MSK);
|
setADCEnableMask(BIT_32_MSK);
|
||||||
@ -814,15 +814,11 @@ int getSpeed(enum speedVariable ind, int mode) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val) {
|
int setReadoutMode(enum readoutMode mode) {
|
||||||
enum readOutFlags retval = GET_READOUT_FLAGS;
|
|
||||||
uint32_t addr = CONFIG_REG;
|
uint32_t addr = CONFIG_REG;
|
||||||
|
switch(mode) {
|
||||||
// set
|
case ANALOG_ONLY:
|
||||||
if (val != GET_READOUT_FLAGS) {
|
FILE_LOG(logINFO, ("Setting Analog Only Readout\n"));
|
||||||
switch(val) {
|
|
||||||
case NORMAL_READOUT:
|
|
||||||
FILE_LOG(logINFO, ("Setting Normal Readout\n"));
|
|
||||||
bus_w(addr, bus_r(addr) & (~CONFIG_DSBL_ANLG_OTPT_MSK) & (~CONFIG_ENBLE_DGTL_OTPT_MSK));
|
bus_w(addr, bus_r(addr) & (~CONFIG_DSBL_ANLG_OTPT_MSK) & (~CONFIG_ENBLE_DGTL_OTPT_MSK));
|
||||||
break;
|
break;
|
||||||
case DIGITAL_ONLY:
|
case DIGITAL_ONLY:
|
||||||
@ -834,41 +830,35 @@ enum readOutFlags setReadOutFlags(enum readOutFlags val) {
|
|||||||
bus_w(addr, (bus_r(addr) & (~CONFIG_DSBL_ANLG_OTPT_MSK)) | CONFIG_ENBLE_DGTL_OTPT_MSK);
|
bus_w(addr, (bus_r(addr) & (~CONFIG_DSBL_ANLG_OTPT_MSK)) | CONFIG_ENBLE_DGTL_OTPT_MSK);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", mode));
|
||||||
return retval;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// get
|
|
||||||
uint32_t regval = bus_r(addr);
|
uint32_t regval = bus_r(addr);
|
||||||
FILE_LOG(logDEBUG1, ("Config Reg: 0x%08x\n", regval));
|
|
||||||
// this bit reads analog disable, so inverse
|
|
||||||
analogEnable = (((regval & CONFIG_DSBL_ANLG_OTPT_MSK) >> CONFIG_DSBL_ANLG_OTPT_OFST) ? 0 : 1);
|
analogEnable = (((regval & CONFIG_DSBL_ANLG_OTPT_MSK) >> CONFIG_DSBL_ANLG_OTPT_OFST) ? 0 : 1);
|
||||||
digitalEnable = ((regval & CONFIG_ENBLE_DGTL_OTPT_MSK) >> CONFIG_ENBLE_DGTL_OTPT_OFST);
|
digitalEnable = ((regval & CONFIG_ENBLE_DGTL_OTPT_MSK) >> CONFIG_ENBLE_DGTL_OTPT_OFST);
|
||||||
|
|
||||||
if (analogEnable && digitalEnable) {
|
|
||||||
retval = ANALOG_AND_DIGITAL;
|
|
||||||
FILE_LOG(logDEBUG1, ("Getting readout: Analog & Digital 0x%x\n", retval));
|
|
||||||
} else if (analogEnable && !digitalEnable) {
|
|
||||||
retval = NORMAL_READOUT;
|
|
||||||
FILE_LOG(logDEBUG1, ("Getting readout: Normal 0x%x\n", retval));
|
|
||||||
} else if (!analogEnable && digitalEnable) {
|
|
||||||
retval = DIGITAL_ONLY;
|
|
||||||
FILE_LOG(logDEBUG1, ("Getting readout: Digital Only 0x%x\n", retval));
|
|
||||||
} else {
|
|
||||||
FILE_LOG(logERROR, ("Read unknown readout (Both digital and analog are disabled). "
|
|
||||||
"Config reg: 0x%x\n", regval));
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update databytes and allocate ram
|
// update databytes and allocate ram
|
||||||
if (allocateRAM() == FAIL) {
|
if (allocateRAM() == FAIL) {
|
||||||
return -2;
|
return FAIL;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
int getReadoutMode() {
|
||||||
|
if (analogEnable && digitalEnable) {
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting readout: Analog & Digita\n"));
|
||||||
|
return ANALOG_AND_DIGITAL;
|
||||||
|
} else if (analogEnable && !digitalEnable) {
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting readout: Analog Only\n"));
|
||||||
|
return ANALOG_ONLY;
|
||||||
|
} else if (!analogEnable && digitalEnable) {
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting readout: Digital Only\n"));
|
||||||
|
return DIGITAL_ONLY;
|
||||||
|
} else {
|
||||||
|
FILE_LOG(logERROR, ("Read unknown readout (Both digital and analog are disabled)\n"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* parameters - timer */
|
/* parameters - timer */
|
||||||
@ -1520,6 +1510,7 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
|
|||||||
FILE_LOG(logINFOBLUE, ("Configuring MAC\n"));
|
FILE_LOG(logINFOBLUE, ("Configuring MAC\n"));
|
||||||
// 1 giga udp
|
// 1 giga udp
|
||||||
if (!enableTenGigabitEthernet(-1)) {
|
if (!enableTenGigabitEthernet(-1)) {
|
||||||
|
FILE_LOG(logINFOBLUE, ("Configuring 1G MAC\n"));
|
||||||
// if it was in 10G mode, it was not allocating RAM
|
// if it was in 10G mode, it was not allocating RAM
|
||||||
if (allocateRAM() == FAIL)
|
if (allocateRAM() == FAIL)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1535,7 +1526,7 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 10 G
|
// 10 G
|
||||||
else {
|
FILE_LOG(logINFOBLUE, ("Configuring 10G MAC\n"));
|
||||||
uint32_t sourceport = DEFAULT_TX_UDP_PORT;
|
uint32_t sourceport = DEFAULT_TX_UDP_PORT;
|
||||||
|
|
||||||
FILE_LOG(logINFO, ("\tSource IP : %d.%d.%d.%d \t\t(0x%08x)\n",
|
FILE_LOG(logINFO, ("\tSource IP : %d.%d.%d.%d \t\t(0x%08x)\n",
|
||||||
@ -1594,8 +1585,8 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
|
|||||||
|
|
||||||
cleanFifos();//FIXME: resetPerpheral() for ctb?
|
cleanFifos();//FIXME: resetPerpheral() for ctb?
|
||||||
resetPeripheral();
|
resetPeripheral();
|
||||||
|
FILE_LOG(logINFO, ("Waiting for %d s for mac to be up\n", WAIT_TIME_CONFIGURE_MAC / (1000 * 1000)));
|
||||||
usleep(WAIT_TIME_CONFIGURE_MAC); // todo maybe without
|
usleep(WAIT_TIME_CONFIGURE_MAC); // todo maybe without
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
|
|||||||
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
|
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
|
||||||
#define WAIT_TIME_US_PLL (10 * 1000)
|
#define WAIT_TIME_US_PLL (10 * 1000)
|
||||||
#define WAIT_TIME_US_STP_ACQ (100)
|
#define WAIT_TIME_US_STP_ACQ (100)
|
||||||
#define WAIT_TIME_CONFIGURE_MAC (500 * 1000)
|
#define WAIT_TIME_CONFIGURE_MAC (2 * 1000 * 1000)
|
||||||
#define WAIT_TIME_PATTERN_READ (10)
|
#define WAIT_TIME_PATTERN_READ (10)
|
||||||
#define WAIT_TIME_1US_FOR_LOOP_CNT (50) // around 30 is 1 us in blackfin
|
#define WAIT_TIME_1US_FOR_LOOP_CNT (50) // around 30 is 1 us in blackfin
|
||||||
|
|
||||||
|
@ -3,13 +3,13 @@ main_inc = ../slsDetectorServer/include/
|
|||||||
main_src = ../slsDetectorServer/src/
|
main_src = ../slsDetectorServer/src/
|
||||||
support_lib = ../../slsSupportLib/include/
|
support_lib = ../../slsSupportLib/include/
|
||||||
|
|
||||||
CROSS = powerpc-4xx-softfloat-
|
|
||||||
BLACKFIN_CC = bfin-uclinux-gcc
|
BLACKFIN_CC = bfin-uclinux-gcc
|
||||||
|
CROSS = powerpc-4xx-softfloat-
|
||||||
CC = $(CROSS)gcc
|
CC = $(CROSS)gcc
|
||||||
CFLAGS += -Wall -DEIGERD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
|
CFLAGS += -Wall -DEIGERD -DSTOP_SERVER -I$(main_inc) -I$(support_lib) -I$(current_dir)#-DVERBOSEI #-DVERBOSE
|
||||||
LDLIBS += -lm
|
LDLIBS += -lm
|
||||||
PROGS = eigerDetectorServer
|
PROGS = eigerDetectorServer
|
||||||
DESTDIR ?= bin
|
DESTDIR = bin
|
||||||
INSTMODE = 0777
|
INSTMODE = 0777
|
||||||
|
|
||||||
SRCS = slsDetectorFunctionList.c HardwareIO.c LocalLinkInterface.c FebInterface.c FebControl.c Beb.c
|
SRCS = slsDetectorFunctionList.c HardwareIO.c LocalLinkInterface.c FebInterface.c FebControl.c Beb.c
|
||||||
|
Binary file not shown.
@ -56,7 +56,7 @@ int eiger_theo_highvoltage = 0;
|
|||||||
int eiger_iodelay = 0;
|
int eiger_iodelay = 0;
|
||||||
int eiger_photonenergy = 0;
|
int eiger_photonenergy = 0;
|
||||||
int eiger_dynamicrange = 0;
|
int eiger_dynamicrange = 0;
|
||||||
int eiger_readoutmode = 0;
|
int eiger_parallelmode = 0;
|
||||||
int eiger_storeinmem = 0;
|
int eiger_storeinmem = 0;
|
||||||
int eiger_overflow32 = 0;
|
int eiger_overflow32 = 0;
|
||||||
int eiger_readoutspeed = 0;
|
int eiger_readoutspeed = 0;
|
||||||
@ -439,9 +439,9 @@ void setupDetector() {
|
|||||||
setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES);
|
setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES);
|
||||||
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
|
setDynamicRange(DEFAULT_DYNAMIC_RANGE);
|
||||||
eiger_photonenergy = DEFAULT_PHOTON_ENERGY;
|
eiger_photonenergy = DEFAULT_PHOTON_ENERGY;
|
||||||
setReadOutFlags(DEFAULT_READOUT_MODE);
|
setParallelMode(DEFAULT_PARALLEL_MODE);
|
||||||
setReadOutFlags(DEFAULT_READOUT_STOREINRAM_MODE);
|
setOverFlowMode(DEFAULT_READOUT_STOREINRAM_MODE);
|
||||||
setReadOutFlags(DEFAULT_READOUT_OVERFLOW32_MODE);
|
setStoreInRamMode(DEFAULT_READOUT_OVERFLOW32_MODE);
|
||||||
setSpeed(CLOCK_DIVIDER, DEFAULT_CLK_SPEED);//clk_devider,half speed
|
setSpeed(CLOCK_DIVIDER, DEFAULT_CLK_SPEED);//clk_devider,half speed
|
||||||
setIODelay(DEFAULT_IO_DELAY);
|
setIODelay(DEFAULT_IO_DELAY);
|
||||||
setTiming(DEFAULT_TIMING_MODE);
|
setTiming(DEFAULT_TIMING_MODE);
|
||||||
@ -543,119 +543,46 @@ int getSpeed(enum speedVariable ind) {
|
|||||||
return eiger_readoutspeed;
|
return eiger_readoutspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int setParallelMode(int mode) {
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val) {
|
mode = (mode == 0 ? E_NON_PARALLEL : E_PARALLEL);
|
||||||
|
|
||||||
enum readOutFlags retval = GET_READOUT_FLAGS;
|
|
||||||
if (val!=GET_READOUT_FLAGS) {
|
|
||||||
|
|
||||||
|
|
||||||
if (val&0xF0000) {
|
|
||||||
switch(val) {
|
|
||||||
case PARALLEL:
|
|
||||||
val=E_PARALLEL;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Parallel\n"));
|
|
||||||
break;
|
|
||||||
case NONPARALLEL:
|
|
||||||
val=E_NON_PARALLEL;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Non Parallel\n"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#ifndef VIRTUAL
|
#ifndef VIRTUAL
|
||||||
if (Feb_Control_SetReadoutMode(val))
|
if (!Feb_Control_SetReadoutMode(mode)) {
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
eiger_readoutmode = val;
|
eiger_parallelmode = mode;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int getParallelMode() {
|
||||||
|
return (eiger_parallelmode == E_PARALLEL ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int setOverFlowMode(int mode) {
|
||||||
|
mode = (mode == 0 ? 0 : 1);
|
||||||
#ifndef VIRTUAL
|
#ifndef VIRTUAL
|
||||||
else return -1;
|
if (Beb_Set32bitOverflow(mode == 0 ? 0 : 1) == -1) {
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
eiger_overflow32 = mode;
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (val&0xF00000) {
|
int getOverFlowMode() {
|
||||||
switch(val) {
|
return eiger_overflow32;
|
||||||
case SHOW_OVERFLOW:
|
|
||||||
val=1;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Overflow in 32 bit mode\n"));
|
|
||||||
break;
|
|
||||||
case NOOVERFLOW:
|
|
||||||
val=0;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: No overflow in 32 bit mode\n"));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#ifndef VIRTUAL
|
|
||||||
if (Beb_Set32bitOverflow(val) != -1)
|
|
||||||
#endif
|
|
||||||
eiger_overflow32 = val;
|
|
||||||
#ifndef VIRTUAL
|
|
||||||
else return -1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setStoreInRamMode(int mode) {
|
||||||
else {
|
mode = (mode == 0 ? 0 : 1);
|
||||||
switch(val) {
|
FILE_LOG(logINFO, ("Setting Store in Ram mode to %d\n", mode));
|
||||||
case STORE_IN_RAM:
|
eiger_storeinmem = mode;
|
||||||
val=1;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Store in Ram\n"));
|
|
||||||
break;
|
|
||||||
case CONTINOUS_RO:
|
|
||||||
val=0;
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting Read out Flag: Continuous Readout\n"));
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
FILE_LOG(logERROR, ("Cannot set unknown readout flag. 0x%x\n", val));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
eiger_storeinmem = val;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(eiger_readoutmode) {
|
int getStoreInRamMode() {
|
||||||
case E_PARALLEL:
|
return eiger_storeinmem;
|
||||||
retval=PARALLEL;
|
|
||||||
break;
|
|
||||||
case E_NON_PARALLEL:
|
|
||||||
retval=NONPARALLEL;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(eiger_overflow32) {
|
|
||||||
case 1:
|
|
||||||
retval|=SHOW_OVERFLOW;
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
retval|=NOOVERFLOW;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
switch(eiger_storeinmem) {
|
|
||||||
case 0:
|
|
||||||
retval|=CONTINOUS_RO;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
retval|=STORE_IN_RAM;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
FILE_LOG(logDEBUG1, ("Read out Flag: 0x%x\n", retval));
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* parameters - timer */
|
/* parameters - timer */
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#define STATUS_ERROR 2
|
#define STATUS_ERROR 2
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum CLK_SPEED_INDEX {FULL_SPEED, HALF_SPEED, QUARTER_SPEED};
|
|
||||||
enum DACINDEX {SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD};
|
enum DACINDEX {SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RXB_RB,RXB_LB,VCMP_RR,VCP,VCN,VIS,VTHRESHOLD};
|
||||||
#define DEFAULT_DAC_VALS { \
|
#define DEFAULT_DAC_VALS { \
|
||||||
0, /* SvP */ \
|
0, /* SvP */ \
|
||||||
@ -31,7 +30,7 @@ enum DACINDEX {SVP,VTR,VRF,VRS,SVN,VTGSTV,VCMP_LL,VCMP_LR,CAL,VCMP_RL,RX
|
|||||||
};
|
};
|
||||||
enum ADCINDEX {TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA, TEMP_FPGAFEBL, TEMP_FPGAFEBR};
|
enum ADCINDEX {TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_FPGA, TEMP_FPGAFEBL, TEMP_FPGAFEBR};
|
||||||
enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
enum NETWORKINDEX {TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||||
enum {E_PARALLEL, E_NON_PARALLEL, E_SAFE};
|
enum {E_PARALLEL, E_NON_PARALLEL};
|
||||||
|
|
||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
#define NCHAN (256 * 256)
|
#define NCHAN (256 * 256)
|
||||||
@ -62,9 +61,9 @@ enum {E_PARALLEL, E_NON_PARALLEL, E_SAFE};
|
|||||||
#define DEFAULT_SUBFRAME_DEADTIME (0)
|
#define DEFAULT_SUBFRAME_DEADTIME (0)
|
||||||
#define DEFAULT_DYNAMIC_RANGE (16)
|
#define DEFAULT_DYNAMIC_RANGE (16)
|
||||||
|
|
||||||
#define DEFAULT_READOUT_MODE (NONPARALLEL)
|
#define DEFAULT_PARALLEL_MODE (0)
|
||||||
#define DEFAULT_READOUT_STOREINRAM_MODE (CONTINOUS_RO)
|
#define DEFAULT_READOUT_STOREINRAM_MODE (0)
|
||||||
#define DEFAULT_READOUT_OVERFLOW32_MODE (NOOVERFLOW)
|
#define DEFAULT_READOUT_OVERFLOW32_MODE (0)
|
||||||
#define DEFAULT_CLK_SPEED (HALF_SPEED)
|
#define DEFAULT_CLK_SPEED (HALF_SPEED)
|
||||||
#define DEFAULT_IO_DELAY (650)
|
#define DEFAULT_IO_DELAY (650)
|
||||||
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
#define DEFAULT_TIMING_MODE (AUTO_TIMING)
|
||||||
|
Binary file not shown.
@ -37,7 +37,6 @@ typedef struct udp_header_struct {
|
|||||||
|
|
||||||
|
|
||||||
/* Enums */
|
/* Enums */
|
||||||
enum CLK_SPEED_INDEX {FULL_SPEED, HALF_SPEED, QUARTER_SPEED};
|
|
||||||
enum ADCINDEX {TEMP_FPGA, TEMP_ADC};
|
enum ADCINDEX {TEMP_FPGA, TEMP_ADC};
|
||||||
enum DACINDEX {VB_COMP, VDD_PROT, VIN_COM, VREF_PRECH, VB_PIXBUF, VB_DS, VREF_DS, VREF_COMP };
|
enum DACINDEX {VB_COMP, VDD_PROT, VIN_COM, VREF_PRECH, VB_PIXBUF, VB_DS, VREF_DS, VREF_COMP };
|
||||||
#define DEFAULT_DAC_VALS { 1220, /* VB_COMP */ \
|
#define DEFAULT_DAC_VALS { 1220, /* VB_COMP */ \
|
||||||
|
@ -47,6 +47,7 @@ static inline void FILELOG_PrintLog(enum TLogLevel level, char* m) {
|
|||||||
case logDEBUG4: cprintf(MAGENTA, "DEBUG4: %s", m); break;
|
case logDEBUG4: cprintf(MAGENTA, "DEBUG4: %s", m); break;
|
||||||
case logDEBUG5: cprintf(MAGENTA, "DEBUG5: %s", m); break;
|
case logDEBUG5: cprintf(MAGENTA, "DEBUG5: %s", m); break;
|
||||||
}
|
}
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline char* FILELOG_BuildLog(const char* fmt, ...) {
|
static inline char* FILELOG_BuildLog(const char* fmt, ...) {
|
||||||
|
@ -138,9 +138,20 @@ int getSpeed(enum speedVariable ind);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EIGERD) || defined(CHIPTESTBOARDD)
|
#ifdef EIGERD
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val);
|
int setParallelMode(int mode);
|
||||||
|
int getParallelMode();
|
||||||
|
int setOverFlowMode(int mode);
|
||||||
|
int getOverFlowMode();
|
||||||
|
void setStoreInRamMode(int mode);
|
||||||
|
int getStoreInRamMode();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CHIPTESTBOARDD
|
||||||
|
int setReadoutMode(enum readoutMode mode);
|
||||||
|
int getReadoutMode();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// parameters - timer
|
// parameters - timer
|
||||||
#ifdef JUNGFRAUD
|
#ifdef JUNGFRAUD
|
||||||
|
@ -47,7 +47,6 @@ int read_all(int);
|
|||||||
int set_timer(int);
|
int set_timer(int);
|
||||||
int get_time_left(int);
|
int get_time_left(int);
|
||||||
int set_dynamic_range(int);
|
int set_dynamic_range(int);
|
||||||
int set_readout_flags(int);
|
|
||||||
int set_roi(int);
|
int set_roi(int);
|
||||||
int get_roi(int);
|
int get_roi(int);
|
||||||
int set_speed(int);
|
int set_speed(int);
|
||||||
@ -109,3 +108,11 @@ int set_interrupt_subframe(int);
|
|||||||
int get_interrupt_subframe(int);
|
int get_interrupt_subframe(int);
|
||||||
int set_read_n_lines(int);
|
int set_read_n_lines(int);
|
||||||
int get_read_n_lines(int);
|
int get_read_n_lines(int);
|
||||||
|
int set_parallel_mode(int);
|
||||||
|
int get_parallel_mode(int);
|
||||||
|
int set_overflow_mode(int);
|
||||||
|
int get_overflow_mode(int);
|
||||||
|
int set_storeinram(int);
|
||||||
|
int get_storeinram(int);
|
||||||
|
int set_readout_mode(int);
|
||||||
|
int get_readout_mode(int);
|
||||||
|
@ -191,7 +191,6 @@ const char* getFunctionName(enum detFuncs func) {
|
|||||||
case F_SET_TIMER: return "F_SET_TIMER";
|
case F_SET_TIMER: return "F_SET_TIMER";
|
||||||
case F_GET_TIME_LEFT: return "F_GET_TIME_LEFT";
|
case F_GET_TIME_LEFT: return "F_GET_TIME_LEFT";
|
||||||
case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE";
|
case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE";
|
||||||
case F_SET_READOUT_FLAGS: return "F_SET_READOUT_FLAGS";
|
|
||||||
case F_SET_ROI: return "F_SET_ROI";
|
case F_SET_ROI: return "F_SET_ROI";
|
||||||
case F_GET_ROI: return "F_GET_ROI";
|
case F_GET_ROI: return "F_GET_ROI";
|
||||||
case F_SET_SPEED: return "F_SET_SPEED";
|
case F_SET_SPEED: return "F_SET_SPEED";
|
||||||
@ -251,6 +250,14 @@ const char* getFunctionName(enum detFuncs func) {
|
|||||||
case F_GET_INTERRUPT_SUBFRAME: return "F_GET_INTERRUPT_SUBFRAME";
|
case F_GET_INTERRUPT_SUBFRAME: return "F_GET_INTERRUPT_SUBFRAME";
|
||||||
case F_SET_READ_N_LINES: return "F_SET_READ_N_LINES";
|
case F_SET_READ_N_LINES: return "F_SET_READ_N_LINES";
|
||||||
case F_GET_READ_N_LINES: return "F_GET_READ_N_LINES";
|
case F_GET_READ_N_LINES: return "F_GET_READ_N_LINES";
|
||||||
|
case F_SET_PARALLEL_MODE: return "F_SET_PARALLEL_MODE";
|
||||||
|
case F_GET_PARALLEL_MODE: return "F_GET_PARALLEL_MODE";
|
||||||
|
case F_SET_OVERFLOW_MODE: return "F_SET_OVERFLOW_MODE";
|
||||||
|
case F_GET_OVERFLOW_MODE: return "F_GET_OVERFLOW_MODE";
|
||||||
|
case F_SET_STOREINRAM_MODE: return "F_SET_STOREINRAM_MODE";
|
||||||
|
case F_GET_STOREINRAM_MODE: return "F_GET_STOREINRAM_MODE";
|
||||||
|
case F_SET_READOUT_MODE: return "F_SET_READOUT_MODE";
|
||||||
|
case F_GET_READOUT_MODE: return "F_GET_READOUT_MODE";
|
||||||
default: return "Unknown Function";
|
default: return "Unknown Function";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,7 +286,6 @@ void function_table() {
|
|||||||
flist[F_SET_TIMER] = &set_timer;
|
flist[F_SET_TIMER] = &set_timer;
|
||||||
flist[F_GET_TIME_LEFT] = &get_time_left;
|
flist[F_GET_TIME_LEFT] = &get_time_left;
|
||||||
flist[F_SET_DYNAMIC_RANGE] = &set_dynamic_range;
|
flist[F_SET_DYNAMIC_RANGE] = &set_dynamic_range;
|
||||||
flist[F_SET_READOUT_FLAGS] = &set_readout_flags;
|
|
||||||
flist[F_SET_ROI] = &set_roi;
|
flist[F_SET_ROI] = &set_roi;
|
||||||
flist[F_GET_ROI] = &get_roi;
|
flist[F_GET_ROI] = &get_roi;
|
||||||
flist[F_SET_SPEED] = &set_speed;
|
flist[F_SET_SPEED] = &set_speed;
|
||||||
@ -339,6 +345,14 @@ void function_table() {
|
|||||||
flist[F_GET_INTERRUPT_SUBFRAME] = &get_interrupt_subframe;
|
flist[F_GET_INTERRUPT_SUBFRAME] = &get_interrupt_subframe;
|
||||||
flist[F_SET_READ_N_LINES] = &set_read_n_lines;
|
flist[F_SET_READ_N_LINES] = &set_read_n_lines;
|
||||||
flist[F_GET_READ_N_LINES] = &get_read_n_lines;
|
flist[F_GET_READ_N_LINES] = &get_read_n_lines;
|
||||||
|
flist[F_SET_PARALLEL_MODE] = &set_parallel_mode;
|
||||||
|
flist[F_GET_PARALLEL_MODE] = &get_parallel_mode;
|
||||||
|
flist[F_SET_OVERFLOW_MODE] = &set_overflow_mode;
|
||||||
|
flist[F_GET_OVERFLOW_MODE] = &get_overflow_mode;
|
||||||
|
flist[F_SET_STOREINRAM_MODE] = &set_storeinram;
|
||||||
|
flist[F_GET_STOREINRAM_MODE] = &get_storeinram;
|
||||||
|
flist[F_SET_READOUT_MODE] = &set_readout_mode;
|
||||||
|
flist[F_GET_READOUT_MODE] = &get_readout_mode;
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||||
@ -1863,60 +1877,6 @@ int set_dynamic_range(int file_des) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int set_readout_flags(int file_des) {
|
|
||||||
ret = OK;
|
|
||||||
memset(mess, 0, sizeof(mess));
|
|
||||||
enum readOutFlags arg = GET_READOUT_FLAGS;
|
|
||||||
enum readOutFlags retval = GET_READOUT_FLAGS;
|
|
||||||
|
|
||||||
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
|
||||||
return printSocketReadError();
|
|
||||||
FILE_LOG(logDEBUG1, ("Setting readout flags to %d\n", arg));
|
|
||||||
|
|
||||||
#if defined(JUNGFRAUD) || defined(GOTTHARDD) || defined(MOENCHD) || defined(MYTHEN3D) || defined(GOTTHARD2D)
|
|
||||||
functionNotImplemented();
|
|
||||||
#else
|
|
||||||
// set & get
|
|
||||||
if ((arg == GET_READOUT_FLAGS) || (Server_VerifyLock() == OK)) {
|
|
||||||
|
|
||||||
switch(arg) {
|
|
||||||
case GET_READOUT_FLAGS:
|
|
||||||
#ifdef EIGERD
|
|
||||||
case STORE_IN_RAM:
|
|
||||||
case CONTINOUS_RO:
|
|
||||||
case PARALLEL:
|
|
||||||
case NONPARALLEL:
|
|
||||||
case SHOW_OVERFLOW:
|
|
||||||
case NOOVERFLOW:
|
|
||||||
#elif CHIPTESTBOARDD
|
|
||||||
case NORMAL_READOUT:
|
|
||||||
case DIGITAL_ONLY:
|
|
||||||
case ANALOG_AND_DIGITAL:
|
|
||||||
#endif
|
|
||||||
retval = setReadOutFlags(arg);
|
|
||||||
FILE_LOG(logDEBUG1, ("Read out flags: 0x%x\n", retval));
|
|
||||||
validate((int)arg, (int)(retval & arg), "set readout flag", HEX);
|
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
|
||||||
if (retval == -2) {
|
|
||||||
ret = FAIL;
|
|
||||||
sprintf(mess, "Readout Flags failed. Cannot allocate RAM\n");
|
|
||||||
FILE_LOG(logERROR,(mess));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
modeNotImplemented("Read out flag index", (int)arg);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int set_roi(int file_des) {
|
int set_roi(int file_des) {
|
||||||
ret = OK;
|
ret = OK;
|
||||||
@ -2273,8 +2233,8 @@ int send_update(int file_des) {
|
|||||||
if (n < 0) return printSocketReadError();
|
if (n < 0) return printSocketReadError();
|
||||||
|
|
||||||
// readout flags
|
// readout flags
|
||||||
#if defined(EIGERD) || defined(CHIPTESTBOARDD)
|
#ifdef CHIPTESTBOARDD
|
||||||
i32 = setReadOutFlags(GET_READOUT_FLAGS);
|
i32 = getReadoutMode();
|
||||||
n = sendData(file_des,&i32,sizeof(i32),INT32);
|
n = sendData(file_des,&i32,sizeof(i32),INT32);
|
||||||
if (n < 0) return printSocketReadError();
|
if (n < 0) return printSocketReadError();
|
||||||
#endif
|
#endif
|
||||||
@ -4151,3 +4111,211 @@ int get_read_n_lines(int file_des) {
|
|||||||
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int set_parallel_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int arg = 0;
|
||||||
|
|
||||||
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
FILE_LOG(logINFO, ("Setting parallel mode: %u\n", arg));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
if(setParallelMode(arg) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not set parallel mode\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else {
|
||||||
|
int retval = getParallelMode();
|
||||||
|
if (arg != retval) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not set parallel mode. Set %d, but read %d\n", retval, arg);
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int get_parallel_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting parallel mode\n"));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only
|
||||||
|
retval = getParallelMode();
|
||||||
|
FILE_LOG(logDEBUG1, ("parallel mode retval: %u\n", retval));
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int set_overflow_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int arg = 0;
|
||||||
|
|
||||||
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
FILE_LOG(logINFO, ("Setting overflow mode: %u\n", arg));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
if(setOverFlowMode(arg) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not set overflow mode\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else {
|
||||||
|
int retval = getOverFlowMode();
|
||||||
|
if (arg != retval) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not set overflow mode. Set %d, but read %d\n", retval, arg);
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int get_overflow_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting overflow mode\n"));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only
|
||||||
|
retval = getOverFlowMode();
|
||||||
|
FILE_LOG(logDEBUG1, ("overflow mode retval: %u\n", retval));
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int set_storeinram(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int arg = 0;
|
||||||
|
|
||||||
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
FILE_LOG(logINFO, ("Setting store in ram mode: %u\n", arg));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
setStoreInRamMode(arg);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int get_storeinram(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting store in ram mode\n"));
|
||||||
|
|
||||||
|
#ifndef EIGERD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only
|
||||||
|
retval = getStoreInRamMode();
|
||||||
|
FILE_LOG(logDEBUG1, ("store in ram mode retval: %u\n", retval));
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int set_readout_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int arg = 0;
|
||||||
|
|
||||||
|
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
FILE_LOG(logINFO, ("Setting readout mode: %u\n", arg));
|
||||||
|
|
||||||
|
#ifndef CHIPTESTBOARDD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
switch(arg){
|
||||||
|
case ANALOG_ONLY:
|
||||||
|
case DIGITAL_ONLY:
|
||||||
|
case ANALOG_AND_DIGITAL:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
modeNotImplemented("Readout mode", (int)arg);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ret == OK) {
|
||||||
|
if (setReadoutMode(arg) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not set allocate RAM to set readout mode\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else {
|
||||||
|
int retval = getReadoutMode();
|
||||||
|
if (retval == -1) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not get readout mode\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else {
|
||||||
|
FILE_LOG(logDEBUG1, ("readout mode retval: %u\n", retval));
|
||||||
|
}
|
||||||
|
validate(arg, retval, "set readout mode", DEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, NULL, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int get_readout_mode(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
FILE_LOG(logDEBUG1, ("Getting readout mode\n"));
|
||||||
|
|
||||||
|
#ifndef CHIPTESTBOARDD
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only
|
||||||
|
retval = getReadoutMode();
|
||||||
|
if (retval == -1) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess, "Could not get readout mode\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else {
|
||||||
|
FILE_LOG(logDEBUG1, ("readout mode retval: %u\n", retval));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, UPDATE, &retval, sizeof(retval));
|
||||||
|
}
|
||||||
|
@ -114,6 +114,9 @@ class CmdProxy {
|
|||||||
{"period", &CmdProxy::Period},
|
{"period", &CmdProxy::Period},
|
||||||
{"subexptime", &CmdProxy::SubExptime},
|
{"subexptime", &CmdProxy::SubExptime},
|
||||||
{"frames", &CmdProxy::frames},
|
{"frames", &CmdProxy::frames},
|
||||||
|
{"parallel", &CmdProxy::parallel},
|
||||||
|
{"overflow", &CmdProxy::overflow},
|
||||||
|
{"storeinram", &CmdProxy::storeinram},
|
||||||
{"fwrite", &CmdProxy::fwrite},
|
{"fwrite", &CmdProxy::fwrite},
|
||||||
{"fmaster", &CmdProxy::fmaster},
|
{"fmaster", &CmdProxy::fmaster},
|
||||||
{"foverwrite", &CmdProxy::foverwrite},
|
{"foverwrite", &CmdProxy::foverwrite},
|
||||||
@ -144,7 +147,8 @@ class CmdProxy {
|
|||||||
{"masterfile", "fmaster"},
|
{"masterfile", "fmaster"},
|
||||||
{"outdir", "fpath"},
|
{"outdir", "fpath"},
|
||||||
{"fileformat", "fformat"},
|
{"fileformat", "fformat"},
|
||||||
{"overwrite", "foverwrite"}};
|
{"overwrite", "foverwrite"},
|
||||||
|
{"flags", "readout"}};
|
||||||
|
|
||||||
void WrongNumberOfParameters(size_t expected);
|
void WrongNumberOfParameters(size_t expected);
|
||||||
|
|
||||||
@ -193,6 +197,15 @@ class CmdProxy {
|
|||||||
|
|
||||||
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex, std::stoi,
|
INTEGER_COMMAND(findex, getAcquisitionIndex, setAcquisitionIndex, std::stoi,
|
||||||
"[0, 1]\n\tFile index");
|
"[0, 1]\n\tFile index");
|
||||||
|
|
||||||
|
INTEGER_COMMAND(parallel, getParallelMode, setParallelMode, std::stoi,
|
||||||
|
"[0, 1]\n\tEnable or disable parallel mode. [Eiger]");
|
||||||
|
|
||||||
|
INTEGER_COMMAND(overflow, getOverFlowMode, setOverFlowMode, std::stoi,
|
||||||
|
"[0, 1]\n\tEnable or disable show overflow flag in 32 bit mode. [Eiger]");
|
||||||
|
|
||||||
|
INTEGER_COMMAND(storeinram, getStoreInRamMode, setStoreInRamMode, std::stoi,
|
||||||
|
"[0, 1]\n\tEnable or disable store in ram mode. [Eiger]");
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sls
|
} // namespace sls
|
||||||
|
@ -154,12 +154,11 @@ class Detector {
|
|||||||
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
Result<ns> getDelayAfterTriggerLeft(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau] */
|
/** [Eiger][Jungfrau] */
|
||||||
Result<int> getSpeed(Positions pos = {}) const;
|
Result<defs::speedLevel> getSpeed(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [Eiger][Jungfrau] // TODO: create enum for speed
|
/** [Eiger][Jungfrau]
|
||||||
* Options: (0 full speed, 1 half speed, 2 quarter speed)
|
* Options: FULL_SPEED, HALF_SPEED, QUARTER_SPEED */
|
||||||
*/
|
void setSpeed(defs::speedLevel value, Positions pos = {});
|
||||||
void setSpeed(int value, Positions pos = {});
|
|
||||||
|
|
||||||
/** [Gotthard][Jungfrau][CTB] */
|
/** [Gotthard][Jungfrau][CTB] */
|
||||||
Result<int> getADCPhase(Positions pos = {}) const;
|
Result<int> getADCPhase(Positions pos = {}) const;
|
||||||
@ -636,6 +635,12 @@ class Detector {
|
|||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
void setOverFlowMode(bool value, Positions pos = {});
|
void setOverFlowMode(bool value, Positions pos = {});
|
||||||
|
|
||||||
|
/** [Eiger] */
|
||||||
|
Result<bool> getStoreInRamMode(Positions pos = {}) const;
|
||||||
|
|
||||||
|
/** [Eiger] */
|
||||||
|
void setStoreInRamMode(bool value, Positions pos = {});
|
||||||
|
|
||||||
/** [Eiger] */
|
/** [Eiger] */
|
||||||
Result<bool> getBottom(Positions pos = {}) const;
|
Result<bool> getBottom(Positions pos = {}) const;
|
||||||
|
|
||||||
@ -852,11 +857,10 @@ class Detector {
|
|||||||
void setNumberOfDigitalSamples(int64_t value, Positions pos = {});
|
void setNumberOfDigitalSamples(int64_t value, Positions pos = {});
|
||||||
|
|
||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
Result<int> getReadoutMode(Positions pos = {}) const;
|
Result<defs::readoutMode> getReadoutMode(Positions pos = {}) const;
|
||||||
|
|
||||||
/** [CTB] Options: NORMAL_READOUT = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL
|
/** [CTB] Options: ANALOG_ONLY = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL */
|
||||||
* //TODO ANALOG_ONLY, make enum = 2 */
|
void setReadoutMode(defs::readoutMode value, Positions pos = {});
|
||||||
void setReadoutMode(int value, Positions pos = {});
|
|
||||||
|
|
||||||
/** [CTB] */
|
/** [CTB] */
|
||||||
Result<int> getDBITPhase(Positions pos = {}) const;
|
Result<int> getDBITPhase(Positions pos = {}) const;
|
||||||
|
@ -778,14 +778,18 @@ class multiSlsDetector : public virtual slsDetectorDefs {
|
|||||||
int detPos = -1); //
|
int detPos = -1); //
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get readout flags (Eiger, Mythen)
|
* Set readout mode (Only for CTB and Moench)
|
||||||
* @param flag readout flag (Eiger options: parallel, nonparallel, safe
|
* @param mode readout mode Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL
|
||||||
* etc.) (-1 gets)
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns readout flag
|
|
||||||
*/
|
*/
|
||||||
int setReadOutFlags(readOutFlags flag = GET_READOUT_FLAGS,
|
void setReadoutMode(const readoutMode mode, int detPos = -1);
|
||||||
int detPos = -1); //
|
|
||||||
|
/**
|
||||||
|
* Get readout mode(Only for CTB and Moench)
|
||||||
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
|
* @returns readout mode
|
||||||
|
*/
|
||||||
|
readoutMode getReadoutMode(int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Interrupt last sub frame (Only for Eiger)
|
* Set Interrupt last sub frame (Only for Eiger)
|
||||||
|
@ -68,8 +68,8 @@ struct sharedSlsDetector {
|
|||||||
/** adc enable mask */
|
/** adc enable mask */
|
||||||
uint32_t adcEnableMask;
|
uint32_t adcEnableMask;
|
||||||
|
|
||||||
/** readout flags */
|
/** readout mode */
|
||||||
slsDetectorDefs::readOutFlags roFlags;
|
slsDetectorDefs::readoutMode roMode;
|
||||||
|
|
||||||
/** detector settings (standard, fast, etc.) */
|
/** detector settings (standard, fast, etc.) */
|
||||||
slsDetectorDefs::detectorSettings currentSettings;
|
slsDetectorDefs::detectorSettings currentSettings;
|
||||||
@ -629,12 +629,52 @@ class slsDetector : public virtual slsDetectorDefs {
|
|||||||
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG);
|
setExternalSignalFlags(externalSignalFlag pol = GET_EXTERNAL_SIGNAL_FLAG);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set/get readout flags (Eiger, Mythen)
|
* Set Parallel readout mode (Only for Eiger)
|
||||||
* @param flag readout flag (Eiger options: parallel, nonparallel, safe
|
* @param enable true if parallel, else false for non parallel
|
||||||
* etc.) (-1 gets)
|
|
||||||
* @returns readout flag
|
|
||||||
*/
|
*/
|
||||||
int setReadOutFlags(readOutFlags flag = GET_READOUT_FLAGS);
|
void setParallelMode(const bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get parallel mode (Only for Eiger)
|
||||||
|
* @returns parallel mode
|
||||||
|
*/
|
||||||
|
bool getParallelMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set overflow readout mode in 32 bit mode (Only for Eiger)
|
||||||
|
* @param enable true if overflow, else false
|
||||||
|
*/
|
||||||
|
void setOverFlowMode(const bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get overflow mode in 32 bit mode (Only for Eiger)
|
||||||
|
* @returns overflow mode
|
||||||
|
*/
|
||||||
|
bool getOverFlowMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set store in ram readout mode (Only for Eiger)
|
||||||
|
* @param enable true if store in ram, else false
|
||||||
|
*/
|
||||||
|
void setStoreInRamMode(const bool enable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get store in ram mode (Only for Eiger)
|
||||||
|
* @returns store in ram mode
|
||||||
|
*/
|
||||||
|
bool getStoreInRamMode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set readout mode (Only for CTB and Moench)
|
||||||
|
* @param mode readout mode Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL
|
||||||
|
*/
|
||||||
|
void setReadoutMode(const readoutMode mode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get readout mode(Only for CTB and Moench)
|
||||||
|
* @returns readout mode
|
||||||
|
*/
|
||||||
|
readoutMode getReadoutMode();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Interrupt last sub frame (Only for Eiger)
|
* Set Interrupt last sub frame (Only for Eiger)
|
||||||
|
@ -398,22 +398,20 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set parallel readout mode (Eiger)
|
* Set parallel readout mode (Eiger)
|
||||||
* @param value readout mode (-1 gets)
|
* @param value readout mode (-1 gets)
|
||||||
* Options: slsDetectorDefs::readOutFlags
|
* false for NonParallel (Default), true for Parallel
|
||||||
* (PARALLEL, NONPARALLEL (Default), SAFE)
|
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns mode register,
|
* @returns 1 for parallel, 0 for non parallel, -1 if different
|
||||||
* result must be ANDED with PARALLEL/NONPARALLEL/SAFE to get mode
|
|
||||||
*/
|
*/
|
||||||
int setParallelMode(int value, int detPos = -1);
|
int setParallelMode(bool value, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set overflow readout mode (Eiger in 32 bit)
|
* Set overflow readout mode (Eiger in 32 bit)
|
||||||
* @param value readout mode (-1 gets)
|
* @param value readout mode (-1 gets)
|
||||||
* Options: 1(SHOW_OVERFLOW), 0(NOOVERFLOW) (Default)
|
* Options: true to Show overflow, false to not show overflow
|
||||||
* @param detPos -1 for all detectors in list or specific detector position
|
* @param detPos -1 for all detectors in list or specific detector position
|
||||||
* @returns 1 if overflow mode else 0
|
* @returns 1 for overflow, 0 for no overflow, -1 if different
|
||||||
*/
|
*/
|
||||||
int setOverflowMode(int value, int detPos = -1);
|
int setOverflowMode(bool value, int detPos = -1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* (Advanced user)
|
* (Advanced user)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#include "Detector.h"
|
#include "Detector.h"
|
||||||
#include "container_utils.h"
|
#include "container_utils.h"
|
||||||
|
#include "detectorData.h"
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "multiSlsDetector.h"
|
#include "multiSlsDetector.h"
|
||||||
#include "slsDetector.h"
|
#include "slsDetector.h"
|
||||||
#include "sls_detector_defs.h"
|
#include "sls_detector_defs.h"
|
||||||
#include "detectorData.h"
|
|
||||||
|
|
||||||
namespace sls {
|
namespace sls {
|
||||||
|
|
||||||
@ -165,13 +165,19 @@ Result<ns> Detector::getDelayAfterTriggerLeft(Positions pos) const {
|
|||||||
defs::DELAY_AFTER_TRIGGER);
|
defs::DELAY_AFTER_TRIGGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getSpeed(Positions pos) const {
|
Result<defs::speedLevel> Detector::getSpeed(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
|
auto res = pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, -1,
|
||||||
0);
|
0);
|
||||||
|
Result<defs::speedLevel> speedResult(res.size());
|
||||||
|
for (size_t i = 0; i < res.size(); ++i) {
|
||||||
|
speedResult[i] = static_cast<defs::speedLevel>(res[i]);
|
||||||
|
}
|
||||||
|
return speedResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setSpeed(int value, Positions pos) {
|
void Detector::setSpeed(defs::speedLevel value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER, value, 0);
|
pimpl->Parallel(&slsDetector::setSpeed, pos, defs::CLOCK_DIVIDER,
|
||||||
|
static_cast<int>(value), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getADCPhase(Positions pos) const {
|
Result<int> Detector::getADCPhase(Positions pos) const {
|
||||||
@ -640,7 +646,8 @@ void Detector::setRxZmqDataStream(bool enable, Positions pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getRxZmqFrequency(Positions pos) const {
|
Result<int> Detector::getRxZmqFrequency(Positions pos) const {
|
||||||
return pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos, -1);
|
return pimpl->Parallel(&slsDetector::setReceiverStreamingFrequency, pos,
|
||||||
|
-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setRxZmqFrequency(int freq, Positions pos) {
|
void Detector::setRxZmqFrequency(int freq, Positions pos) {
|
||||||
@ -775,33 +782,27 @@ void Detector::setRxAddGapPixels(bool enable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result<bool> Detector::getParallelMode(Positions pos) const {
|
Result<bool> Detector::getParallelMode(Positions pos) const {
|
||||||
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
|
return pimpl->Parallel(&slsDetector::getParallelMode, pos);
|
||||||
defs::GET_READOUT_FLAGS);
|
|
||||||
Result<bool> booleanRes(res.size());
|
|
||||||
for (size_t i = 0; i < res.size(); ++i) {
|
|
||||||
booleanRes[i] = res[i] & defs::PARALLEL;
|
|
||||||
}
|
|
||||||
return booleanRes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setParallelMode(bool value, Positions pos) {
|
void Detector::setParallelMode(bool value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
|
pimpl->Parallel(&slsDetector::setParallelMode, pos, value);
|
||||||
value ? defs::PARALLEL : defs::NONPARALLEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<bool> Detector::getOverFlowMode(Positions pos) const {
|
Result<bool> Detector::getOverFlowMode(Positions pos) const {
|
||||||
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
|
return pimpl->Parallel(&slsDetector::getOverFlowMode, pos);
|
||||||
defs::GET_READOUT_FLAGS);
|
|
||||||
Result<bool> booleanRes(res.size());
|
|
||||||
for (size_t i = 0; i < res.size(); ++i) {
|
|
||||||
booleanRes[i] = res[i] & defs::SHOW_OVERFLOW;
|
|
||||||
}
|
|
||||||
return booleanRes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setOverFlowMode(bool value, Positions pos) {
|
void Detector::setOverFlowMode(bool value, Positions pos) {
|
||||||
pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
|
pimpl->Parallel(&slsDetector::setOverFlowMode, pos, value);
|
||||||
value ? defs::SHOW_OVERFLOW : defs::NOOVERFLOW);
|
}
|
||||||
|
|
||||||
|
Result<bool> Detector::getStoreInRamMode(Positions pos) const {
|
||||||
|
return pimpl->Parallel(&slsDetector::getStoreInRamMode, pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Detector::setStoreInRamMode(bool value, Positions pos) {
|
||||||
|
pimpl->Parallel(&slsDetector::setStoreInRamMode, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<bool> Detector::getBottom(Positions pos) const {
|
Result<bool> Detector::getBottom(Positions pos) const {
|
||||||
@ -1056,39 +1057,12 @@ void Detector::setNumberOfDigitalSamples(int64_t value, Positions pos) {
|
|||||||
pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
|
pimpl->Parallel(&slsDetector::setTimer, pos, defs::DIGITAL_SAMPLES, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getReadoutMode(Positions pos) const {
|
Result<defs::readoutMode> Detector::getReadoutMode(Positions pos) const {
|
||||||
auto res = pimpl->Parallel(&slsDetector::setReadOutFlags, pos,
|
return pimpl->Parallel(&slsDetector::getReadoutMode, pos);
|
||||||
defs::GET_READOUT_FLAGS);
|
|
||||||
for (auto &it : res) {
|
|
||||||
if (it & defs::ANALOG_AND_DIGITAL) {
|
|
||||||
it = 2;
|
|
||||||
} else if (it & defs::DIGITAL_ONLY) {
|
|
||||||
it = 1;
|
|
||||||
} else if (it == defs::NORMAL_READOUT) {
|
|
||||||
it = 0;
|
|
||||||
} else {
|
|
||||||
throw RuntimeError("Unknown Signal Type");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setReadoutMode(int value, Positions pos) {
|
void Detector::setReadoutMode(defs::readoutMode value, Positions pos) {
|
||||||
defs::readOutFlags flag;
|
pimpl->Parallel(&slsDetector::setReadoutMode, pos, value);
|
||||||
switch (value) {
|
|
||||||
case 0:
|
|
||||||
flag = defs::NORMAL_READOUT;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
flag = defs::DIGITAL_ONLY;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
flag = defs::ANALOG_AND_DIGITAL;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw RuntimeError("Unknown Signal Type");
|
|
||||||
}
|
|
||||||
pimpl->Parallel(&slsDetector::setReadOutFlags, pos, flag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getDBITPhase(Positions pos) const {
|
Result<int> Detector::getDBITPhase(Positions pos) const {
|
||||||
|
@ -1154,14 +1154,24 @@ multiSlsDetector::setExternalSignalFlags(externalSignalFlag pol, int detPos) {
|
|||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::setReadOutFlags(readOutFlags flag, int detPos) {
|
void multiSlsDetector::setReadoutMode(const slsDetectorDefs::readoutMode mode, int detPos) {
|
||||||
// single
|
// single
|
||||||
if (detPos >= 0) {
|
if (detPos >= 0) {
|
||||||
return detectors[detPos]->setReadOutFlags(flag);
|
detectors[detPos]->setReadoutMode(mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi
|
// multi
|
||||||
auto r = parallelCall(&slsDetector::setReadOutFlags, flag);
|
parallelCall(&slsDetector::setReadoutMode, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
slsDetectorDefs::readoutMode multiSlsDetector::getReadoutMode(int detPos) {
|
||||||
|
// single
|
||||||
|
if (detPos >= 0) {
|
||||||
|
return (detectors[detPos]->getReadoutMode());
|
||||||
|
}
|
||||||
|
|
||||||
|
// multi
|
||||||
|
auto r = parallelCall(&slsDetector::getReadoutMode);
|
||||||
return sls::minusOneIfDifferent(r);
|
return sls::minusOneIfDifferent(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
shm()->roi.xmin = -1;
|
shm()->roi.xmin = -1;
|
||||||
shm()->roi.xmax = -1;
|
shm()->roi.xmax = -1;
|
||||||
shm()->adcEnableMask = BIT32_MASK;
|
shm()->adcEnableMask = BIT32_MASK;
|
||||||
shm()->roFlags = NORMAL_READOUT;
|
shm()->roMode = ANALOG_ONLY;
|
||||||
shm()->currentSettings = UNINITIALIZED;
|
shm()->currentSettings = UNINITIALIZED;
|
||||||
shm()->currentThresholdEV = -1;
|
shm()->currentThresholdEV = -1;
|
||||||
shm()->timerValue[FRAME_NUMBER] = 1;
|
shm()->timerValue[FRAME_NUMBER] = 1;
|
||||||
@ -417,7 +417,6 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
shm()->nGappixels.y = parameters.nGappixelsY;
|
shm()->nGappixels.y = parameters.nGappixelsY;
|
||||||
|
|
||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
// readoutflags (ctb only)
|
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,8 +572,8 @@ void slsDetector::updateNumberOfChannels() {
|
|||||||
|
|
||||||
int nachans = 0, ndchans = 0;
|
int nachans = 0, ndchans = 0;
|
||||||
// analog channels (normal, analog/digital readout)
|
// analog channels (normal, analog/digital readout)
|
||||||
if (shm()->roFlags == slsDetectorDefs::NORMAL_READOUT ||
|
if (shm()->roMode == slsDetectorDefs::ANALOG_ONLY ||
|
||||||
((shm()->roFlags & slsDetectorDefs::ANALOG_AND_DIGITAL) != 0)) {
|
shm()->roMode == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
uint32_t mask = shm()->adcEnableMask;
|
uint32_t mask = shm()->adcEnableMask;
|
||||||
if (mask == BIT32_MASK) {
|
if (mask == BIT32_MASK) {
|
||||||
nachans = 32;
|
nachans = 32;
|
||||||
@ -589,8 +588,8 @@ void slsDetector::updateNumberOfChannels() {
|
|||||||
|
|
||||||
// digital channels (ctb only, digital, analog/digital readout)
|
// digital channels (ctb only, digital, analog/digital readout)
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD &&
|
if (shm()->myDetectorType == CHIPTESTBOARD &&
|
||||||
(((shm()->roFlags & DIGITAL_ONLY) != 0) ||
|
(shm()->roMode == DIGITAL_ONLY ||
|
||||||
((shm()->roFlags & ANALOG_AND_DIGITAL) != 0))) {
|
shm()->roMode == ANALOG_AND_DIGITAL)) {
|
||||||
ndchans = 64;
|
ndchans = 64;
|
||||||
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans;
|
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans;
|
||||||
}
|
}
|
||||||
@ -804,11 +803,10 @@ void slsDetector::updateCachedDetectorVariables() {
|
|||||||
n += client.Receive(&i64, sizeof(i64));
|
n += client.Receive(&i64, sizeof(i64));
|
||||||
shm()->timerValue[CYCLES_NUMBER] = i64;
|
shm()->timerValue[CYCLES_NUMBER] = i64;
|
||||||
|
|
||||||
// readout flags
|
// readout mode
|
||||||
if (shm()->myDetectorType == EIGER ||
|
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
||||||
shm()->myDetectorType == CHIPTESTBOARD) {
|
|
||||||
n += client.Receive(&i32, sizeof(i32));
|
n += client.Receive(&i32, sizeof(i32));
|
||||||
shm()->roFlags = static_cast<readOutFlags>(i32);
|
shm()->roMode = static_cast<readoutMode>(i32);
|
||||||
}
|
}
|
||||||
|
|
||||||
// roi
|
// roi
|
||||||
@ -841,7 +839,6 @@ void slsDetector::updateCachedDetectorVariables() {
|
|||||||
setAdditionalJsonParameter("adcmask", std::to_string(u32));
|
setAdditionalJsonParameter("adcmask", std::to_string(u32));
|
||||||
|
|
||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1350,7 +1347,6 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
|||||||
FILE_LOG(logDEBUG1) << getTimerType(index) << ": " << retval;
|
FILE_LOG(logDEBUG1) << getTimerType(index) << ": " << retval;
|
||||||
shm()->timerValue[index] = retval;
|
shm()->timerValue[index] = retval;
|
||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
|
||||||
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
@ -1491,27 +1487,80 @@ slsDetector::setExternalSignalFlags(externalSignalFlag pol) {
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::setReadOutFlags(readOutFlags flag) {
|
void slsDetector::setParallelMode(const bool enable) {
|
||||||
auto arg = static_cast<int>(flag);
|
int arg = static_cast<int>(enable);
|
||||||
readOutFlags retval = GET_READOUT_FLAGS;
|
FILE_LOG(logDEBUG1) << "Setting parallel mode to " << arg;
|
||||||
FILE_LOG(logDEBUG1) << "Setting readout flags to " << flag;
|
sendToDetector(F_SET_PARALLEL_MODE, arg, nullptr);
|
||||||
sendToDetector(F_SET_READOUT_FLAGS, arg, retval);
|
}
|
||||||
FILE_LOG(logDEBUG1) << "Readout flag: " << retval;
|
|
||||||
shm()->roFlags = retval;
|
bool slsDetector::getParallelMode() {
|
||||||
|
int retval = -1;
|
||||||
|
FILE_LOG(logDEBUG1) << "Getting parallel mode";
|
||||||
|
sendToDetector(F_GET_PARALLEL_MODE, nullptr, retval);
|
||||||
|
FILE_LOG(logDEBUG1) << "Parallel mode: " << retval;
|
||||||
|
return static_cast<bool>(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void slsDetector::setOverFlowMode(const bool enable) {
|
||||||
|
int arg = static_cast<int>(enable);
|
||||||
|
FILE_LOG(logDEBUG1) << "Setting overflow mode to " << arg;
|
||||||
|
sendToDetector(F_SET_OVERFLOW_MODE, arg, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool slsDetector::getOverFlowMode() {
|
||||||
|
int retval = -1;
|
||||||
|
FILE_LOG(logDEBUG1) << "Getting overflow mode";
|
||||||
|
sendToDetector(F_GET_OVERFLOW_MODE, nullptr, retval);
|
||||||
|
FILE_LOG(logDEBUG1) << "overflow mode: " << retval;
|
||||||
|
return static_cast<bool>(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void slsDetector::setStoreInRamMode(const bool enable) {
|
||||||
|
int arg = static_cast<int>(enable);
|
||||||
|
FILE_LOG(logDEBUG1) << "Setting store in ram mode to " << arg;
|
||||||
|
sendToDetector(F_SET_STOREINRAM_MODE, arg, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool slsDetector::getStoreInRamMode() {
|
||||||
|
int retval = -1;
|
||||||
|
FILE_LOG(logDEBUG1) << "Getting store in ram mode";
|
||||||
|
sendToDetector(F_GET_STOREINRAM_MODE, nullptr, retval);
|
||||||
|
FILE_LOG(logDEBUG1) << "store in ram mode: " << retval;
|
||||||
|
return static_cast<bool>(retval);
|
||||||
|
}
|
||||||
|
|
||||||
|
void slsDetector::setReadoutMode(const slsDetectorDefs::readoutMode mode) {
|
||||||
|
uint32_t arg = static_cast<uint32_t>(mode);
|
||||||
|
FILE_LOG(logDEBUG1) << "Setting readout mode to " << arg;
|
||||||
|
sendToDetector(F_SET_READOUT_MODE, arg, nullptr);
|
||||||
|
shm()->roMode = mode;
|
||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
}
|
}
|
||||||
FILE_LOG(logDEBUG1) << "Setting receiver readout flags to " << arg;
|
|
||||||
if (shm()->useReceiverFlag) {
|
if (shm()->useReceiverFlag) {
|
||||||
int fnum = F_RECEIVER_SET_READOUT_FLAGS;
|
sendToReceiver(F_RECEIVER_SET_READOUT_MODE, mode, nullptr);
|
||||||
arg = shm()->roFlags;
|
|
||||||
retval = static_cast<readOutFlags>(-1);
|
|
||||||
sendToReceiver(fnum, &arg, sizeof(arg), &retval, sizeof(retval));
|
|
||||||
FILE_LOG(logDEBUG1) << "Receiver readout flag: " << retval;
|
|
||||||
}
|
}
|
||||||
return shm()->roFlags;
|
}
|
||||||
|
|
||||||
|
slsDetectorDefs::readoutMode slsDetector::getReadoutMode() {
|
||||||
|
int retval = -1;
|
||||||
|
FILE_LOG(logDEBUG1) << "Getting readout mode";
|
||||||
|
sendToDetector(F_GET_READOUT_MODE, nullptr, retval);
|
||||||
|
FILE_LOG(logDEBUG1) << "Readout mode: " << retval;
|
||||||
|
readoutMode oldmode = shm()->roMode;
|
||||||
|
shm()->roMode = static_cast<readoutMode>(retval);
|
||||||
|
|
||||||
|
if (oldmode != shm()->roMode) {
|
||||||
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
|
if (shm()->myDetectorType == CHIPTESTBOARD) {
|
||||||
|
updateNumberOfChannels();
|
||||||
|
}
|
||||||
|
if (shm()->useReceiverFlag) {
|
||||||
|
sendToReceiver(F_RECEIVER_SET_READOUT_MODE, shm()->roMode, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return shm()->roMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void slsDetector::setInterruptSubframe(const bool enable) {
|
void slsDetector::setInterruptSubframe(const bool enable) {
|
||||||
@ -1731,7 +1780,6 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
|||||||
static_cast<int>(shm()->rxPadDeactivatedModules));
|
static_cast<int>(shm()->rxPadDeactivatedModules));
|
||||||
enableGapPixels(shm()->gappixels);
|
enableGapPixels(shm()->gappixels);
|
||||||
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
||||||
setReadOutFlags(GET_READOUT_FLAGS);
|
|
||||||
setQuad(getQuad());
|
setQuad(getQuad());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1739,7 +1787,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
|||||||
setTimer(ANALOG_SAMPLES, shm()->timerValue[ANALOG_SAMPLES]);
|
setTimer(ANALOG_SAMPLES, shm()->timerValue[ANALOG_SAMPLES]);
|
||||||
setTimer(DIGITAL_SAMPLES, shm()->timerValue[DIGITAL_SAMPLES]);
|
setTimer(DIGITAL_SAMPLES, shm()->timerValue[DIGITAL_SAMPLES]);
|
||||||
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
||||||
setReadOutFlags(GET_READOUT_FLAGS);
|
setReadoutMode(shm()->roMode);
|
||||||
setADCEnableMask(shm()->adcEnableMask);
|
setADCEnableMask(shm()->adcEnableMask);
|
||||||
setReceiverDbitOffset(shm()->rxDbitOffset);
|
setReceiverDbitOffset(shm()->rxDbitOffset);
|
||||||
setReceiverDbitList(shm()->rxDbitList);
|
setReceiverDbitList(shm()->rxDbitList);
|
||||||
@ -2276,7 +2324,6 @@ void slsDetector::setADCEnableMask(uint32_t mask) {
|
|||||||
shm()->adcEnableMask = mask;
|
shm()->adcEnableMask = mask;
|
||||||
|
|
||||||
// update #nchan, as it depends on #samples, adcmask,
|
// update #nchan, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
|
||||||
updateNumberOfChannels();
|
updateNumberOfChannels();
|
||||||
|
|
||||||
// send to processor
|
// send to processor
|
||||||
|
@ -351,9 +351,9 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \page config
|
/*! \page config
|
||||||
- <b>flags [flag]</b> sets/gets the readout flags to mode. Options: none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown. Used for EIGER only. \c Returns \c (string). put takes one string and \c returns concatenation of all active flags separated by spaces.
|
- <b>romode [b]</b> sets/gets the readout flag. Options: analog, digital, analog_digital. Used for CTB only. \c Returns \c (int)
|
||||||
*/
|
*/
|
||||||
descrToFuncMap[i].m_pFuncName = "flags";
|
descrToFuncMap[i].m_pFuncName = "romode";
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdAdvanced;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
@ -691,7 +691,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*! \page config
|
/*! \page config
|
||||||
- <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau, full speed is not implemented and overwrites adcphase to recommended default. Not for Gotthard. \c Returns \c (int)
|
- <b>clkdivider [i]</b> sets/gets the readout clock divider. EIGER, JUNGFRAU [0(fast speed), 1(half speed), 2(quarter speed)]. Jungfrau also overwrites adcphase to recommended default. For CTB, it is the run clock in MHz. Not for Gotthard. \c Returns \c (int)
|
||||||
*/
|
*/
|
||||||
descrToFuncMap[i].m_pFuncName = "clkdivider";
|
descrToFuncMap[i].m_pFuncName = "clkdivider";
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdSpeed;
|
||||||
@ -4282,9 +4282,15 @@ std::string slsDetectorCommand::cmdSpeed(int narg, const char * const args[], in
|
|||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
if (sscanf(args[1], "%d", &t))
|
if (sscanf(args[1], "%d", &t))
|
||||||
;
|
;
|
||||||
else
|
else {
|
||||||
|
// if parameer is a string (unknown speed will throw)
|
||||||
|
if (cmd == "clkdivider") {
|
||||||
|
speedLevel lev = getSpeedLevelType(std::string(args[1]));
|
||||||
|
t = static_cast<int>(lev);
|
||||||
|
}
|
||||||
return std::string("cannot scan speed value ") + std::string(args[1]);
|
return std::string("cannot scan speed value ") + std::string(args[1]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ret = myDet->setSpeed(index, t, mode, detPos);
|
ret = myDet->setSpeed(index, t, mode, detPos);
|
||||||
@ -4325,72 +4331,17 @@ std::string slsDetectorCommand::helpSpeed(int action) {
|
|||||||
std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[], int action, int detPos) {
|
std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[], int action, int detPos) {
|
||||||
|
|
||||||
|
|
||||||
char answer[1000] = "";
|
|
||||||
|
|
||||||
if (action == HELP_ACTION)
|
if (action == HELP_ACTION)
|
||||||
return helpAdvanced(action);
|
return helpAdvanced(action);
|
||||||
|
|
||||||
if (cmd == "flags") {
|
if (cmd == "romode") {
|
||||||
|
|
||||||
readOutFlags flag = GET_READOUT_FLAGS;
|
|
||||||
|
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
std::string sval = std::string(args[1]);
|
myDet->setReadoutMode(getReadoutModeType(std::string(args[1])), detPos);
|
||||||
if (sval == "none")
|
}
|
||||||
flag = NORMAL_READOUT;
|
return getReadoutModeType(myDet->getReadoutMode());
|
||||||
else if (sval == "storeinram")
|
|
||||||
flag = STORE_IN_RAM;
|
|
||||||
else if (sval == "tot")
|
|
||||||
flag = TOT_MODE;
|
|
||||||
else if (sval == "continous")
|
|
||||||
flag = CONTINOUS_RO;
|
|
||||||
else if (sval == "parallel")
|
|
||||||
flag = PARALLEL;
|
|
||||||
else if (sval == "nonparallel")
|
|
||||||
flag = NONPARALLEL;
|
|
||||||
else if (sval == "digital")
|
|
||||||
flag = DIGITAL_ONLY;
|
|
||||||
else if (sval == "analog_digital")
|
|
||||||
flag = ANALOG_AND_DIGITAL;
|
|
||||||
else if (sval == "overflow")
|
|
||||||
flag = SHOW_OVERFLOW;
|
|
||||||
else if (sval == "nooverflow")
|
|
||||||
flag = NOOVERFLOW;
|
|
||||||
else
|
|
||||||
return std::string("could not scan flag ") + std::string(args[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int retval = myDet->setReadOutFlags(flag, detPos);
|
else if (cmd=="interruptsubframe") {
|
||||||
|
|
||||||
// std::cout << std::hex << flag << " " << retval << std::endl;
|
|
||||||
|
|
||||||
if (retval == NORMAL_READOUT)
|
|
||||||
return std::string("none");
|
|
||||||
|
|
||||||
if (retval & STORE_IN_RAM)
|
|
||||||
strcat(answer, "storeinram ");
|
|
||||||
if (retval & TOT_MODE)
|
|
||||||
strcat(answer, "tot ");
|
|
||||||
if (retval & CONTINOUS_RO)
|
|
||||||
strcat(answer, "continous ");
|
|
||||||
if (retval & PARALLEL)
|
|
||||||
strcat(answer, "parallel ");
|
|
||||||
if (retval & NONPARALLEL)
|
|
||||||
strcat(answer, "nonparallel ");
|
|
||||||
if (retval & DIGITAL_ONLY)
|
|
||||||
strcat(answer, "digital ");
|
|
||||||
if (retval & ANALOG_AND_DIGITAL)
|
|
||||||
strcat(answer, "analog_digital ");
|
|
||||||
if (retval & SHOW_OVERFLOW)
|
|
||||||
strcat(answer, "overflow ");
|
|
||||||
if (retval & NOOVERFLOW)
|
|
||||||
strcat(answer, "nooverflow ");
|
|
||||||
if (strlen(answer))
|
|
||||||
return std::string(answer);
|
|
||||||
|
|
||||||
return std::string("unknown");
|
|
||||||
|
|
||||||
} else if (cmd=="interruptsubframe") {
|
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
int ival = -1;
|
int ival = -1;
|
||||||
if (!sscanf(args[1],"%d",&ival))
|
if (!sscanf(args[1],"%d",&ival))
|
||||||
@ -4399,7 +4350,9 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
}
|
}
|
||||||
return std::to_string(myDet->getInterruptSubframe());
|
return std::to_string(myDet->getInterruptSubframe());
|
||||||
|
|
||||||
} else if (cmd == "readnlines") {
|
}
|
||||||
|
|
||||||
|
else if (cmd == "readnlines") {
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
int ival = -1;
|
int ival = -1;
|
||||||
if (!sscanf(args[1],"%d",&ival))
|
if (!sscanf(args[1],"%d",&ival))
|
||||||
@ -4408,7 +4361,9 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
}
|
}
|
||||||
return std::to_string(myDet->getReadNLines());
|
return std::to_string(myDet->getReadNLines());
|
||||||
|
|
||||||
} else if (cmd == "extsig") {
|
}
|
||||||
|
|
||||||
|
else if (cmd == "extsig") {
|
||||||
externalSignalFlag flag = GET_EXTERNAL_SIGNAL_FLAG;
|
externalSignalFlag flag = GET_EXTERNAL_SIGNAL_FLAG;
|
||||||
|
|
||||||
if (action == PUT_ACTION) {
|
if (action == PUT_ACTION) {
|
||||||
@ -4419,7 +4374,9 @@ std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[],
|
|||||||
|
|
||||||
return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, detPos));
|
return myDet->externalSignalType(myDet->setExternalSignalFlags(flag, detPos));
|
||||||
|
|
||||||
} else if (cmd == "programfpga") {
|
}
|
||||||
|
|
||||||
|
else if (cmd == "programfpga") {
|
||||||
if (action == GET_ACTION)
|
if (action == GET_ACTION)
|
||||||
return std::string("cannot get");
|
return std::string("cannot get");
|
||||||
if (strstr(args[1], ".pof") == nullptr)
|
if (strstr(args[1], ".pof") == nullptr)
|
||||||
@ -4528,7 +4485,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
|||||||
if (action == PUT_ACTION || action == HELP_ACTION) {
|
if (action == PUT_ACTION || action == HELP_ACTION) {
|
||||||
|
|
||||||
os << "extsig mode \t sets the mode of the external signal. can be trigger_out_rising_edge, trigger_out_falling_edge. Gotthard only" << std::endl;
|
os << "extsig mode \t sets the mode of the external signal. can be trigger_out_rising_edge, trigger_out_falling_edge. Gotthard only" << std::endl;
|
||||||
os << "flags mode \t sets the readout flags to mode. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overlow, nooverflow, unknown." << std::endl;
|
os << "romode m \t sets the readout flag to m. Options: analog, digital, analog_digital. Used for CTB only." << std::endl;
|
||||||
os << "interruptsubframe flag \t sets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
os << "interruptsubframe flag \t sets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
||||||
os << "readnlines f \t sets the number of rows to read out per half module. Options: 1 - 256 (Not all values as it depends on dynamic range and 10GbE enabled). Used for EIGER only. " << std::endl;
|
os << "readnlines f \t sets the number of rows to read out per half module. Options: 1 - 256 (Not all values as it depends on dynamic range and 10GbE enabled). Used for EIGER only. " << std::endl;
|
||||||
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
|
os << "programfpga f \t programs the fpga with file f (with .pof extension)." << std::endl;
|
||||||
@ -4544,7 +4501,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
|
|||||||
if (action == GET_ACTION || action == HELP_ACTION) {
|
if (action == GET_ACTION || action == HELP_ACTION) {
|
||||||
|
|
||||||
os << "extsig \t gets the mode of the external signal. can be trigger_in_rising_edge, trigger_in_falling_edge. Gotthard only" << std::endl;
|
os << "extsig \t gets the mode of the external signal. can be trigger_in_rising_edge, trigger_in_falling_edge. Gotthard only" << std::endl;
|
||||||
os << "flags \t gets the readout flags. can be none, storeinram, tot, continous, parallel, nonparallel, digital, analog_digital, overflow, nooverflow, unknown" << std::endl;
|
os << "romode \t gets the readout flag. Options: analog, digital, analog_digital. Used for CTB only." << std::endl;
|
||||||
os << "interruptsubframe \t gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
os << "interruptsubframe \t gets the interrupt subframe flag. Setting it to 1 will interrupt the last subframe at the required exposure time. By default, this is disabled and set to 0, ie. it will wait for the last sub frame to finish exposing. Used for EIGER in 32 bit mode only." << std::endl;
|
||||||
os << "readnlines \t gets the number of rows to read out per half module. Used for EIGER only. " << std::endl;
|
os << "readnlines \t gets the number of rows to read out per half module. Used for EIGER only. " << std::endl;
|
||||||
os << "led \t returns led status (0 off, 1 on)" << std::endl;
|
os << "led \t returns led status (0 off, 1 on)" << std::endl;
|
||||||
|
@ -167,23 +167,22 @@ int slsDetectorUsers::setClockDivider(int value, int detPos) {
|
|||||||
return detector.setSpeed(slsDetectorDefs::CLOCK_DIVIDER, value, detPos);
|
return detector.setSpeed(slsDetectorDefs::CLOCK_DIVIDER, value, detPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setParallelMode(int value, int detPos) {
|
int slsDetectorUsers::setParallelMode(bool value, int detPos) {
|
||||||
if(value >= 0)
|
/* to be uncommented when moving to Detector.h
|
||||||
detector.setReadOutFlags(slsDetectorDefs::readOutFlags(value), detPos);
|
detector.setParallelMode(value, {detPos});
|
||||||
return detector.setReadOutFlags(slsDetectorDefs::GET_READOUT_FLAGS, detPos);
|
auto res = detector.getParallelMode({detPos});
|
||||||
|
if (res.equal())
|
||||||
|
return res.front();*/
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setOverflowMode(int value, int detPos) {
|
int slsDetectorUsers::setOverflowMode(bool value, int detPos) {
|
||||||
if(value >= 0) {
|
/* to be uncommented when moving to Detector.h
|
||||||
if (value == 1)
|
detector.setOverFlowMode(value, {detPos});
|
||||||
detector.setReadOutFlags(slsDetectorDefs::SHOW_OVERFLOW, detPos);
|
auto res = detector.getOverFlowMode({detPos});
|
||||||
else
|
if (res.equal())
|
||||||
detector.setReadOutFlags(slsDetectorDefs::NOOVERFLOW, detPos);
|
return res.front();*/
|
||||||
}
|
|
||||||
int ret = detector.setReadOutFlags(slsDetectorDefs::GET_READOUT_FLAGS, detPos);
|
|
||||||
if (ret == -1)
|
|
||||||
return -1;
|
return -1;
|
||||||
return ((ret & slsDetectorDefs::SHOW_OVERFLOW) ? 1 : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetectorUsers::setAllTrimbits(int val, int detPos) {
|
int slsDetectorUsers::setAllTrimbits(int val, int detPos) {
|
||||||
|
@ -134,7 +134,6 @@ class BinaryFileStatic {
|
|||||||
"Period (ns) : %lld\n"
|
"Period (ns) : %lld\n"
|
||||||
"Gap Pixels Enable : %d\n"
|
"Gap Pixels Enable : %d\n"
|
||||||
"Quad Enable : %d\n"
|
"Quad Enable : %d\n"
|
||||||
"Parallel Flag : %d\n"
|
|
||||||
"Analog Flag : %d\n"
|
"Analog Flag : %d\n"
|
||||||
"Digital Flag : %d\n"
|
"Digital Flag : %d\n"
|
||||||
"ADC Mask : %d\n"
|
"ADC Mask : %d\n"
|
||||||
@ -174,7 +173,6 @@ class BinaryFileStatic {
|
|||||||
(long long int)attr.periodNs,
|
(long long int)attr.periodNs,
|
||||||
attr.gapPixelsEnable,
|
attr.gapPixelsEnable,
|
||||||
attr.quadEnable,
|
attr.quadEnable,
|
||||||
attr.parallelFlag,
|
|
||||||
attr.analogFlag,
|
attr.analogFlag,
|
||||||
attr.digitalFlag,
|
attr.digitalFlag,
|
||||||
attr.adcmask,
|
attr.adcmask,
|
||||||
|
@ -200,7 +200,7 @@ public:
|
|||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
* @returns analog data bytes
|
* @returns analog data bytes
|
||||||
*/
|
*/
|
||||||
virtual int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
virtual int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode) {
|
||||||
FILE_LOG(logERROR) << "setImageSize is a generic function that should be overloaded by a derived class";
|
FILE_LOG(logERROR) << "setImageSize is a generic function that should be overloaded by a derived class";
|
||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
@ -576,14 +576,13 @@ public:
|
|||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
* @returns analog data bytes
|
* @returns analog data bytes
|
||||||
*/
|
*/
|
||||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode f) {
|
||||||
int nachans = 0, ndchans = 0;
|
int nachans = 0, ndchans = 0;
|
||||||
int adatabytes = 0, ddatabytes = 0;
|
int adatabytes = 0, ddatabytes = 0;
|
||||||
|
|
||||||
if (f != slsDetectorDefs::GET_READOUT_FLAGS) {
|
|
||||||
// analog channels (normal, analog/digital readout)
|
// analog channels (normal, analog/digital readout)
|
||||||
if (f == slsDetectorDefs::NORMAL_READOUT ||
|
if (f == slsDetectorDefs::ANALOG_ONLY ||
|
||||||
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
if (a == BIT32_MASK) {
|
if (a == BIT32_MASK) {
|
||||||
nachans = 32;
|
nachans = 32;
|
||||||
} else {
|
} else {
|
||||||
@ -597,8 +596,8 @@ public:
|
|||||||
<< " Databytes: " << adatabytes;
|
<< " Databytes: " << adatabytes;
|
||||||
}
|
}
|
||||||
// digital channels
|
// digital channels
|
||||||
if (f & slsDetectorDefs::DIGITAL_ONLY ||
|
if (f == slsDetectorDefs::DIGITAL_ONLY ||
|
||||||
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
f == slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
ndchans = NCHAN_DIGITAL;
|
ndchans = NCHAN_DIGITAL;
|
||||||
ddatabytes = (sizeof(uint64_t) * ds);
|
ddatabytes = (sizeof(uint64_t) * ds);
|
||||||
FILE_LOG(logDEBUG1) << "Number of Digital Channels:" << ndchans
|
FILE_LOG(logDEBUG1) << "Number of Digital Channels:" << ndchans
|
||||||
@ -606,7 +605,7 @@ public:
|
|||||||
}
|
}
|
||||||
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans + ndchans
|
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans + ndchans
|
||||||
<< " Databytes: " << adatabytes + ddatabytes;
|
<< " Databytes: " << adatabytes + ddatabytes;
|
||||||
}
|
|
||||||
nPixelsX = nachans + ndchans;
|
nPixelsX = nachans + ndchans;
|
||||||
nPixelsY = 1;
|
nPixelsY = 1;
|
||||||
// 10G
|
// 10G
|
||||||
@ -692,7 +691,7 @@ public:
|
|||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
* @returns analog data bytes
|
* @returns analog data bytes
|
||||||
*/
|
*/
|
||||||
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
int setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readoutMode) {
|
||||||
int nachans = 0;
|
int nachans = 0;
|
||||||
int adatabytes = 0;
|
int adatabytes = 0;
|
||||||
|
|
||||||
|
@ -407,10 +407,6 @@ public:
|
|||||||
dataset = group5.createDataSet ( "quad enable", PredType::NATIVE_INT, dataspace );
|
dataset = group5.createDataSet ( "quad enable", PredType::NATIVE_INT, dataspace );
|
||||||
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
||||||
|
|
||||||
//Parallel Flag
|
|
||||||
dataset = group5.createDataSet ( "parallel flag", PredType::NATIVE_INT, dataspace );
|
|
||||||
dataset.write ( &(attr.gapPixelsEnable), PredType::NATIVE_INT);
|
|
||||||
|
|
||||||
//Analog Flag
|
//Analog Flag
|
||||||
dataset = group5.createDataSet ( "analog flag", PredType::NATIVE_INT, dataspace );
|
dataset = group5.createDataSet ( "analog flag", PredType::NATIVE_INT, dataspace );
|
||||||
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
dataset.write ( &(attr.quadEnable), PredType::NATIVE_INT);
|
||||||
|
@ -65,7 +65,6 @@ struct masterAttributes {
|
|||||||
uint64_t periodNs;
|
uint64_t periodNs;
|
||||||
uint32_t gapPixelsEnable;
|
uint32_t gapPixelsEnable;
|
||||||
uint32_t quadEnable;
|
uint32_t quadEnable;
|
||||||
uint32_t parallelFlag;
|
|
||||||
uint32_t analogFlag;
|
uint32_t analogFlag;
|
||||||
uint32_t digitalFlag;
|
uint32_t digitalFlag;
|
||||||
uint32_t adcmask;
|
uint32_t adcmask;
|
||||||
|
@ -88,10 +88,10 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
|||||||
int getReadNLines() const;
|
int getReadNLines() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get readout flags (Eiger, chiptestboard, moench)
|
* Get readout mode (chiptestboard)
|
||||||
* @return readout flags
|
* @return readout mode
|
||||||
*/
|
*/
|
||||||
readOutFlags getReadOutFlags() const;
|
readoutMode getReadoutMode() const;
|
||||||
|
|
||||||
//***file parameters***
|
//***file parameters***
|
||||||
/**
|
/**
|
||||||
@ -417,11 +417,11 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
|||||||
void setReadNLines(const int value);
|
void setReadNLines(const int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set readout flags (eiger, chiptestboard, moench)
|
* Set readout mode (chiptestboard)
|
||||||
* @param f readout flag
|
* @param f readout mode
|
||||||
* @return OK or FAIL
|
* @return OK or FAIL
|
||||||
*/
|
*/
|
||||||
int setReadOutFlags(const readOutFlags f);
|
int setReadoutMode(const readoutMode f);
|
||||||
|
|
||||||
//***file parameters***
|
//***file parameters***
|
||||||
/**
|
/**
|
||||||
@ -902,8 +902,8 @@ class slsReceiverImplementation : private virtual slsDetectorDefs {
|
|||||||
bool quadEnable;
|
bool quadEnable;
|
||||||
/** num lines readout */
|
/** num lines readout */
|
||||||
int numLinesReadout;
|
int numLinesReadout;
|
||||||
/** readout flags*/
|
/** readout mode*/
|
||||||
readOutFlags readoutFlags;
|
readoutMode readoutType;
|
||||||
|
|
||||||
//*** receiver parameters ***
|
//*** receiver parameters ***
|
||||||
/** Number of Threads */
|
/** Number of Threads */
|
||||||
|
@ -279,8 +279,8 @@ class slsReceiverTCPIPInterface : private virtual slsDetectorDefs {
|
|||||||
/** set deactivated receiver padding enable */
|
/** set deactivated receiver padding enable */
|
||||||
int set_deactivated_padding_enable(sls::ServerInterface2 &socket);
|
int set_deactivated_padding_enable(sls::ServerInterface2 &socket);
|
||||||
|
|
||||||
/** set readout flags */
|
/** set readout mode */
|
||||||
int set_readout_flags(sls::ServerInterface2 &socket);
|
int set_readout_mode(sls::ServerInterface2 &socket);
|
||||||
|
|
||||||
/** set adc mask */
|
/** set adc mask */
|
||||||
int set_adc_mask(sls::ServerInterface2 &socket);
|
int set_adc_mask(sls::ServerInterface2 &socket);
|
||||||
|
@ -71,7 +71,7 @@ void slsReceiverImplementation::InitializeMembers() {
|
|||||||
gapPixelsEnable = false;
|
gapPixelsEnable = false;
|
||||||
quadEnable = false;
|
quadEnable = false;
|
||||||
numLinesReadout = MAX_EIGER_ROWS_PER_READOUT;
|
numLinesReadout = MAX_EIGER_ROWS_PER_READOUT;
|
||||||
readoutFlags = GET_READOUT_FLAGS;
|
readoutType = ANALOG_ONLY;
|
||||||
|
|
||||||
//*** receiver parameters ***
|
//*** receiver parameters ***
|
||||||
numThreads = 1;
|
numThreads = 1;
|
||||||
@ -168,10 +168,10 @@ int slsReceiverImplementation::getReadNLines() const {
|
|||||||
return numLinesReadout;
|
return numLinesReadout;
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::readOutFlags
|
slsDetectorDefs::readoutMode
|
||||||
slsReceiverImplementation::getReadOutFlags() const {
|
slsReceiverImplementation::getReadoutMode() const {
|
||||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||||
return readoutFlags;
|
return readoutType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***file parameters***/
|
/***file parameters***/
|
||||||
@ -546,48 +546,23 @@ void slsReceiverImplementation::setReadNLines(const int value) {
|
|||||||
FILE_LOG(logINFO) << "Number of Lines to readout: " << numLinesReadout;
|
FILE_LOG(logINFO) << "Number of Lines to readout: " << numLinesReadout;
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsReceiverImplementation::setReadOutFlags(const readOutFlags f) {
|
int slsReceiverImplementation::setReadoutMode(const readoutMode f) {
|
||||||
if (readoutFlags != f) {
|
if (readoutType != f) {
|
||||||
readoutFlags = f;
|
readoutType = f;
|
||||||
|
|
||||||
// side effects
|
// side effects
|
||||||
if (myDetectorType == CHIPTESTBOARD) {
|
|
||||||
ctbAnalogDataBytes = generalData->setImageSize(
|
ctbAnalogDataBytes = generalData->setImageSize(
|
||||||
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
||||||
tengigaEnable, readoutFlags);
|
tengigaEnable, readoutType);
|
||||||
for (const auto &it : dataProcessor)
|
for (const auto &it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
if (SetupFifoStructure() == FAIL)
|
if (SetupFifoStructure() == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
std::string flag;
|
|
||||||
if (f == NORMAL_READOUT)
|
|
||||||
flag = "normal(analog, no digital)";
|
|
||||||
else if (f & STORE_IN_RAM)
|
|
||||||
flag.append("storeinram ");
|
|
||||||
if (f & TOT_MODE)
|
|
||||||
flag.append("tot ");
|
|
||||||
if (f & CONTINOUS_RO)
|
|
||||||
flag.append("continous ");
|
|
||||||
if (f & PARALLEL)
|
|
||||||
flag.append("parallel ");
|
|
||||||
if (f & NONPARALLEL)
|
|
||||||
flag.append("nonparallel ");
|
|
||||||
if (f & DIGITAL_ONLY)
|
|
||||||
flag.append("digital ");
|
|
||||||
if (f & ANALOG_AND_DIGITAL)
|
|
||||||
flag.append("analog_digital ");
|
|
||||||
if (f & SHOW_OVERFLOW)
|
|
||||||
flag.append("overflow ");
|
|
||||||
if (f & NOOVERFLOW)
|
|
||||||
flag.append("nooverflow ");
|
|
||||||
|
|
||||||
FILE_LOG(logINFO) << "ReadoutFlags: " << flag;
|
FILE_LOG(logINFO) << "Readout Mode: " << getReadoutModeType(f);
|
||||||
if (myDetectorType == CHIPTESTBOARD) {
|
|
||||||
FILE_LOG(logINFO) << "Packets per Frame: "
|
FILE_LOG(logINFO) << "Packets per Frame: "
|
||||||
<< (generalData->packetsPerFrame);
|
<< (generalData->packetsPerFrame);
|
||||||
}
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -874,19 +849,9 @@ int slsReceiverImplementation::setADCEnableMask(uint32_t mask) {
|
|||||||
if (adcEnableMask != mask) {
|
if (adcEnableMask != mask) {
|
||||||
adcEnableMask = mask;
|
adcEnableMask = mask;
|
||||||
|
|
||||||
switch (myDetectorType) {
|
|
||||||
case MOENCH:
|
|
||||||
generalData->setImageSize(mask, numberOfAnalogSamples,
|
|
||||||
numberOfDigitalSamples, tengigaEnable);
|
|
||||||
break;
|
|
||||||
case CHIPTESTBOARD:
|
|
||||||
ctbAnalogDataBytes = generalData->setImageSize(
|
ctbAnalogDataBytes = generalData->setImageSize(
|
||||||
mask, numberOfAnalogSamples, numberOfDigitalSamples,
|
mask, numberOfAnalogSamples, numberOfDigitalSamples,
|
||||||
tengigaEnable, readoutFlags);
|
tengigaEnable, readoutType);
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const auto &it : dataProcessor)
|
for (const auto &it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
@ -1018,14 +983,10 @@ int slsReceiverImplementation::setNumberofAnalogSamples(const uint64_t i) {
|
|||||||
if (numberOfAnalogSamples != i) {
|
if (numberOfAnalogSamples != i) {
|
||||||
numberOfAnalogSamples = i;
|
numberOfAnalogSamples = i;
|
||||||
|
|
||||||
if (myDetectorType == MOENCH) {
|
|
||||||
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples,
|
|
||||||
numberOfDigitalSamples, tengigaEnable);
|
|
||||||
} else if (myDetectorType == CHIPTESTBOARD) {
|
|
||||||
ctbAnalogDataBytes = generalData->setImageSize(
|
ctbAnalogDataBytes = generalData->setImageSize(
|
||||||
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
||||||
tengigaEnable, readoutFlags);
|
tengigaEnable, readoutType);
|
||||||
}
|
|
||||||
for (const auto &it : dataProcessor)
|
for (const auto &it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
if (SetupFifoStructure() == FAIL)
|
if (SetupFifoStructure() == FAIL)
|
||||||
@ -1041,14 +1002,10 @@ int slsReceiverImplementation::setNumberofDigitalSamples(const uint64_t i) {
|
|||||||
if (numberOfDigitalSamples != i) {
|
if (numberOfDigitalSamples != i) {
|
||||||
numberOfDigitalSamples = i;
|
numberOfDigitalSamples = i;
|
||||||
|
|
||||||
if (myDetectorType == MOENCH) {
|
|
||||||
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples,
|
|
||||||
numberOfDigitalSamples, tengigaEnable);
|
|
||||||
} else if (myDetectorType == CHIPTESTBOARD) {
|
|
||||||
ctbAnalogDataBytes = generalData->setImageSize(
|
ctbAnalogDataBytes = generalData->setImageSize(
|
||||||
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
||||||
tengigaEnable, readoutFlags);
|
tengigaEnable, readoutType);
|
||||||
}
|
|
||||||
for (const auto &it : dataProcessor)
|
for (const auto &it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
if (SetupFifoStructure() == FAIL)
|
if (SetupFifoStructure() == FAIL)
|
||||||
@ -1087,13 +1044,10 @@ int slsReceiverImplementation::setTenGigaEnable(const bool b) {
|
|||||||
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable);
|
generalData->SetGapPixelsEnable(gapPixelsEnable, dynamicRange, quadEnable);
|
||||||
break;
|
break;
|
||||||
case MOENCH:
|
case MOENCH:
|
||||||
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples,
|
|
||||||
numberOfDigitalSamples, tengigaEnable);
|
|
||||||
break;
|
|
||||||
case CHIPTESTBOARD:
|
case CHIPTESTBOARD:
|
||||||
ctbAnalogDataBytes = generalData->setImageSize(
|
ctbAnalogDataBytes = generalData->setImageSize(
|
||||||
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples,
|
||||||
tengigaEnable, readoutFlags);
|
tengigaEnable, readoutType);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -1653,9 +1607,8 @@ int slsReceiverImplementation::SetupWriter() {
|
|||||||
attr.periodNs = acquisitionPeriod;
|
attr.periodNs = acquisitionPeriod;
|
||||||
attr.gapPixelsEnable = gapPixelsEnable;
|
attr.gapPixelsEnable = gapPixelsEnable;
|
||||||
attr.quadEnable = quadEnable;
|
attr.quadEnable = quadEnable;
|
||||||
attr.parallelFlag = (readoutFlags & PARALLEL) ? 1 : 0;
|
attr.analogFlag = (readoutType == ANALOG_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1 : 0;
|
||||||
attr.analogFlag = (readoutFlags == NORMAL_READOUT || readoutFlags & ANALOG_AND_DIGITAL) ? 1 : 0;
|
attr.digitalFlag = (readoutType == DIGITAL_ONLY || readoutType == ANALOG_AND_DIGITAL) ? 1 : 0;
|
||||||
attr.digitalFlag = (readoutFlags & DIGITAL_ONLY || readoutFlags & ANALOG_AND_DIGITAL) ? 1 : 0;
|
|
||||||
attr.adcmask = adcEnableMask;
|
attr.adcmask = adcEnableMask;
|
||||||
attr.dbitoffset = ctbDbitOffset;
|
attr.dbitoffset = ctbDbitOffset;
|
||||||
attr.dbitlist = 0;
|
attr.dbitlist = 0;
|
||||||
|
@ -195,7 +195,7 @@ int slsReceiverTCPIPInterface::function_table(){
|
|||||||
flist[F_RECEIVER_DISCARD_POLICY] = &slsReceiverTCPIPInterface::set_discard_policy;
|
flist[F_RECEIVER_DISCARD_POLICY] = &slsReceiverTCPIPInterface::set_discard_policy;
|
||||||
flist[F_RECEIVER_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_padding_enable;
|
flist[F_RECEIVER_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_padding_enable;
|
||||||
flist[F_RECEIVER_DEACTIVATED_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_deactivated_padding_enable;
|
flist[F_RECEIVER_DEACTIVATED_PADDING_ENABLE] = &slsReceiverTCPIPInterface::set_deactivated_padding_enable;
|
||||||
flist[F_RECEIVER_SET_READOUT_FLAGS] = &slsReceiverTCPIPInterface::set_readout_flags;
|
flist[F_RECEIVER_SET_READOUT_MODE] = &slsReceiverTCPIPInterface::set_readout_mode;
|
||||||
flist[F_RECEIVER_SET_ADC_MASK] = &slsReceiverTCPIPInterface::set_adc_mask;
|
flist[F_RECEIVER_SET_ADC_MASK] = &slsReceiverTCPIPInterface::set_adc_mask;
|
||||||
flist[F_SET_RECEIVER_DBIT_LIST] = &slsReceiverTCPIPInterface::set_dbit_list;
|
flist[F_SET_RECEIVER_DBIT_LIST] = &slsReceiverTCPIPInterface::set_dbit_list;
|
||||||
flist[F_GET_RECEIVER_DBIT_LIST] = &slsReceiverTCPIPInterface::get_dbit_list;
|
flist[F_GET_RECEIVER_DBIT_LIST] = &slsReceiverTCPIPInterface::get_dbit_list;
|
||||||
@ -1230,22 +1230,21 @@ int slsReceiverTCPIPInterface::set_deactivated_padding_enable(
|
|||||||
return socket.sendResult(retval);
|
return socket.sendResult(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsReceiverTCPIPInterface::set_readout_flags(Interface &socket) {
|
int slsReceiverTCPIPInterface::set_readout_mode(Interface &socket) {
|
||||||
auto arg = socket.Receive<readOutFlags>();
|
auto arg = socket.Receive<readoutMode>();
|
||||||
|
|
||||||
if (myDetectorType == JUNGFRAU || myDetectorType == GOTTHARD ||
|
if (myDetectorType != CHIPTESTBOARD)
|
||||||
myDetectorType == MOENCH)
|
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
|
|
||||||
if (arg >= 0) {
|
if (arg >= 0) {
|
||||||
VerifyIdle(socket);
|
VerifyIdle(socket);
|
||||||
FILE_LOG(logDEBUG1) << "Setting readout flag: " << arg;
|
FILE_LOG(logDEBUG1) << "Setting readout mode: " << arg;
|
||||||
impl()->setReadOutFlags(arg);
|
impl()->setReadoutMode(arg);
|
||||||
}
|
}
|
||||||
auto retval = impl()->getReadOutFlags();
|
auto retval = impl()->getReadoutMode();
|
||||||
validate(static_cast<int>(arg), static_cast<int>(retval & arg),
|
validate(static_cast<int>(arg), static_cast<int>(retval),
|
||||||
"set readout flags", HEX);
|
"set readout mode", DEC);
|
||||||
FILE_LOG(logDEBUG1) << "Readout flags: " << retval;
|
FILE_LOG(logDEBUG1) << "Readout mode: " << retval;
|
||||||
return socket.sendResult(retval);
|
return socket.sendResult(retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,36 +499,23 @@ format
|
|||||||
DBIT_PIPELINE, /**< adc pipeline */
|
DBIT_PIPELINE, /**< adc pipeline */
|
||||||
MAX_ADC_PHASE_SHIFT, /** max adc phase shift */
|
MAX_ADC_PHASE_SHIFT, /** max adc phase shift */
|
||||||
MAX_DBIT_PHASE_SHIFT, /** max adc phase shift */
|
MAX_DBIT_PHASE_SHIFT, /** max adc phase shift */
|
||||||
SYNC_CLOCK,
|
SYNC_CLOCK
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
readout flags
|
* read out mode (ctb, moench)
|
||||||
*/
|
*/
|
||||||
enum readOutFlags {
|
enum readoutMode {
|
||||||
GET_READOUT_FLAGS = -1, /**< return readout flags */
|
ANALOG_ONLY,
|
||||||
NORMAL_READOUT = 0, /**< no flag */
|
DIGITAL_ONLY,
|
||||||
STORE_IN_RAM = 0x1, /**< data are stored in ram and sent only after end
|
ANALOG_AND_DIGITAL
|
||||||
of acquisition for faster frame rate */
|
};
|
||||||
READ_HITS = 0x2, /**< return only the number of the channel which
|
|
||||||
counted ate least one */
|
/** chip speed */
|
||||||
ZERO_COMPRESSION = 0x4, /**< returned data are 0-compressed */
|
enum speedLevel {
|
||||||
PUMP_PROBE_MODE = 0x8, /**<pump-probe mode */
|
FULL_SPEED,
|
||||||
BACKGROUND_CORRECTIONS = 0x1000, /**<background corrections */
|
HALF_SPEED,
|
||||||
TOT_MODE = 0x2000, /**< pump-probe mode */
|
QUARTER_SPEED
|
||||||
CONTINOUS_RO = 0x4000, /**< pump-probe mode */
|
|
||||||
PARALLEL = 0x10000, /**< eiger parallel mode */
|
|
||||||
NONPARALLEL = 0x20000, /**< eiger serial mode */
|
|
||||||
DIGITAL_ONLY = 0x80000, /** chiptest board read only digital bits (not
|
|
||||||
adc values)*/
|
|
||||||
ANALOG_AND_DIGITAL = 0x100000, /** chiptest board read adc values and
|
|
||||||
digital bits digital bits */
|
|
||||||
DUT_CLK = 0x200000, /** chiptest board fifo clock comes from device
|
|
||||||
under test */
|
|
||||||
SHOW_OVERFLOW = 0x400000, /** eiger 32 bit mode, show saturated for
|
|
||||||
overflow of single subframes */
|
|
||||||
NOOVERFLOW = 0x800000 /** eiger 32 bit mode, do not show saturated for
|
|
||||||
overflow of single subframes */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** port type */
|
/** port type */
|
||||||
@ -900,6 +887,56 @@ format
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** returns string from readoutMode */
|
||||||
|
static std::string getReadoutModeType(readoutMode mode) {
|
||||||
|
switch(mode) {
|
||||||
|
case ANALOG_ONLY:
|
||||||
|
return "analog";
|
||||||
|
case DIGITAL_ONLY:
|
||||||
|
return "digital";
|
||||||
|
case ANALOG_AND_DIGITAL:
|
||||||
|
return "analog_digital";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** returns readoutMode from string */
|
||||||
|
static readoutMode getReadoutModeType(std::string smode) {
|
||||||
|
if (smode == "analog")
|
||||||
|
return ANALOG_ONLY;
|
||||||
|
if (smode == "digital")
|
||||||
|
return DIGITAL_ONLY;
|
||||||
|
if (smode == "analog_digital")
|
||||||
|
return ANALOG_AND_DIGITAL;
|
||||||
|
throw sls::RuntimeError("Unknown readout mode " + smode);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** returns string from speedLevel */
|
||||||
|
static std::string getSpeedLevelType(speedLevel mode) {
|
||||||
|
switch(mode) {
|
||||||
|
case FULL_SPEED:
|
||||||
|
return "full_speed";
|
||||||
|
case HALF_SPEED:
|
||||||
|
return "half_speed";
|
||||||
|
case QUARTER_SPEED:
|
||||||
|
return "quarter_speed";
|
||||||
|
default:
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** returns speedLevel from string */
|
||||||
|
static speedLevel getSpeedLevelType(std::string smode) {
|
||||||
|
if (smode == "full_speed")
|
||||||
|
return FULL_SPEED;
|
||||||
|
if (smode == "half_speed")
|
||||||
|
return HALF_SPEED;
|
||||||
|
if (smode == "quarter_speed")
|
||||||
|
return QUARTER_SPEED;
|
||||||
|
throw sls::RuntimeError("Unknown speed level mode " + smode);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@short returns adc index from std::string
|
@short returns adc index from std::string
|
||||||
\param s can be temp_fpga, temp_fpgaext, temp_10ge, temp_dcdc, temp_sodl,
|
\param s can be temp_fpga, temp_fpgaext, temp_10ge, temp_dcdc, temp_sodl,
|
||||||
|
@ -33,7 +33,6 @@ enum detFuncs{
|
|||||||
F_SET_TIMER, /**< set/get timer value */
|
F_SET_TIMER, /**< set/get timer value */
|
||||||
F_GET_TIME_LEFT, /**< get current value of the timer (time left) */
|
F_GET_TIME_LEFT, /**< get current value of the timer (time left) */
|
||||||
F_SET_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
F_SET_DYNAMIC_RANGE, /**< set/get detector dynamic range */
|
||||||
F_SET_READOUT_FLAGS, /**< set/get readout flags */
|
|
||||||
F_SET_ROI, /**< set/get region of interest */
|
F_SET_ROI, /**< set/get region of interest */
|
||||||
F_GET_ROI,
|
F_GET_ROI,
|
||||||
F_SET_SPEED, /**< set/get readout speed parameters */
|
F_SET_SPEED, /**< set/get readout speed parameters */
|
||||||
@ -93,6 +92,14 @@ enum detFuncs{
|
|||||||
F_GET_INTERRUPT_SUBFRAME,
|
F_GET_INTERRUPT_SUBFRAME,
|
||||||
F_SET_READ_N_LINES,
|
F_SET_READ_N_LINES,
|
||||||
F_GET_READ_N_LINES,
|
F_GET_READ_N_LINES,
|
||||||
|
F_SET_PARALLEL_MODE,
|
||||||
|
F_GET_PARALLEL_MODE,
|
||||||
|
F_SET_OVERFLOW_MODE,
|
||||||
|
F_GET_OVERFLOW_MODE,
|
||||||
|
F_SET_STOREINRAM_MODE,
|
||||||
|
F_GET_STOREINRAM_MODE,
|
||||||
|
F_SET_READOUT_MODE,
|
||||||
|
F_GET_READOUT_MODE,
|
||||||
NUM_DET_FUNCTIONS,
|
NUM_DET_FUNCTIONS,
|
||||||
|
|
||||||
RECEIVER_ENUM_START = 128, /**< detector function should not exceed this (detector server should not compile anyway) */
|
RECEIVER_ENUM_START = 128, /**< detector function should not exceed this (detector server should not compile anyway) */
|
||||||
@ -145,7 +152,7 @@ enum detFuncs{
|
|||||||
F_RECEIVER_DISCARD_POLICY, /** < frames discard policy */
|
F_RECEIVER_DISCARD_POLICY, /** < frames discard policy */
|
||||||
F_RECEIVER_PADDING_ENABLE, /** < partial frames padding enable */
|
F_RECEIVER_PADDING_ENABLE, /** < partial frames padding enable */
|
||||||
F_RECEIVER_DEACTIVATED_PADDING_ENABLE, /** < deactivated receiver padding enable */
|
F_RECEIVER_DEACTIVATED_PADDING_ENABLE, /** < deactivated receiver padding enable */
|
||||||
F_RECEIVER_SET_READOUT_FLAGS, /**< set/get receiver readout flags */
|
F_RECEIVER_SET_READOUT_MODE, /**< set/get receiver readout mode */
|
||||||
F_RECEIVER_SET_ADC_MASK, /**< set adc mask */
|
F_RECEIVER_SET_ADC_MASK, /**< set adc mask */
|
||||||
F_SET_RECEIVER_DBIT_LIST, /** < set receiver digital bit list */
|
F_SET_RECEIVER_DBIT_LIST, /** < set receiver digital bit list */
|
||||||
F_GET_RECEIVER_DBIT_LIST, /** < get receiver digital bit list */
|
F_GET_RECEIVER_DBIT_LIST, /** < get receiver digital bit list */
|
||||||
@ -181,7 +188,6 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_SET_TIMER: return "F_SET_TIMER";
|
case F_SET_TIMER: return "F_SET_TIMER";
|
||||||
case F_GET_TIME_LEFT: return "F_GET_TIME_LEFT";
|
case F_GET_TIME_LEFT: return "F_GET_TIME_LEFT";
|
||||||
case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE";
|
case F_SET_DYNAMIC_RANGE: return "F_SET_DYNAMIC_RANGE";
|
||||||
case F_SET_READOUT_FLAGS: return "F_SET_READOUT_FLAGS";
|
|
||||||
case F_SET_ROI: return "F_SET_ROI";
|
case F_SET_ROI: return "F_SET_ROI";
|
||||||
case F_GET_ROI: return "F_GET_ROI";
|
case F_GET_ROI: return "F_GET_ROI";
|
||||||
case F_SET_SPEED: return "F_SET_SPEED";
|
case F_SET_SPEED: return "F_SET_SPEED";
|
||||||
@ -241,6 +247,14 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_GET_INTERRUPT_SUBFRAME: return "F_GET_INTERRUPT_SUBFRAME";
|
case F_GET_INTERRUPT_SUBFRAME: return "F_GET_INTERRUPT_SUBFRAME";
|
||||||
case F_SET_READ_N_LINES: return "F_SET_READ_N_LINES";
|
case F_SET_READ_N_LINES: return "F_SET_READ_N_LINES";
|
||||||
case F_GET_READ_N_LINES: return "F_GET_READ_N_LINES";
|
case F_GET_READ_N_LINES: return "F_GET_READ_N_LINES";
|
||||||
|
case F_SET_PARALLEL_MODE: return "F_SET_PARALLEL_MODE";
|
||||||
|
case F_GET_PARALLEL_MODE: return "F_GET_PARALLEL_MODE";
|
||||||
|
case F_SET_OVERFLOW_MODE: return "F_SET_OVERFLOW_MODE";
|
||||||
|
case F_GET_OVERFLOW_MODE: return "F_GET_OVERFLOW_MODE";
|
||||||
|
case F_SET_STOREINRAM_MODE: return "F_SET_STOREINRAM_MODE";
|
||||||
|
case F_GET_STOREINRAM_MODE: return "F_GET_STOREINRAM_MODE";
|
||||||
|
case F_SET_READOUT_MODE: return "F_SET_READOUT_MODE";
|
||||||
|
case F_GET_READOUT_MODE: return "F_GET_READOUT_MODE";
|
||||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||||
|
|
||||||
@ -293,7 +307,7 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_RECEIVER_DISCARD_POLICY: return "F_RECEIVER_DISCARD_POLICY";
|
case F_RECEIVER_DISCARD_POLICY: return "F_RECEIVER_DISCARD_POLICY";
|
||||||
case F_RECEIVER_PADDING_ENABLE: return "F_RECEIVER_PADDING_ENABLE";
|
case F_RECEIVER_PADDING_ENABLE: return "F_RECEIVER_PADDING_ENABLE";
|
||||||
case F_RECEIVER_DEACTIVATED_PADDING_ENABLE: return "F_RECEIVER_DEACTIVATED_PADDING_ENABLE";
|
case F_RECEIVER_DEACTIVATED_PADDING_ENABLE: return "F_RECEIVER_DEACTIVATED_PADDING_ENABLE";
|
||||||
case F_RECEIVER_SET_READOUT_FLAGS: return "F_RECEIVER_SET_READOUT_FLAGS";
|
case F_RECEIVER_SET_READOUT_MODE: return "F_RECEIVER_SET_READOUT_MODE";
|
||||||
case F_RECEIVER_SET_ADC_MASK: return "F_RECEIVER_SET_ADC_MASK";
|
case F_RECEIVER_SET_ADC_MASK: return "F_RECEIVER_SET_ADC_MASK";
|
||||||
case F_SET_RECEIVER_DBIT_LIST: return "F_SET_RECEIVER_DBIT_LIST";
|
case F_SET_RECEIVER_DBIT_LIST: return "F_SET_RECEIVER_DBIT_LIST";
|
||||||
case F_GET_RECEIVER_DBIT_LIST: return "F_GET_RECEIVER_DBIT_LIST";
|
case F_GET_RECEIVER_DBIT_LIST: return "F_GET_RECEIVER_DBIT_LIST";
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#define APIRECEIVER 0x190722
|
#define APIRECEIVER 0x190722
|
||||||
#define APIGUI 0x190723
|
#define APIGUI 0x190723
|
||||||
#define APIMOENCH 0x190820
|
#define APIMOENCH 0x190820
|
||||||
#define APICTB 0x190830
|
|
||||||
#define APIGOTTHARD 0x190830
|
#define APIGOTTHARD 0x190830
|
||||||
#define APIJUNGFRAU 0x190830
|
|
||||||
#define APIMYTHEN3 0x190830
|
#define APIMYTHEN3 0x190830
|
||||||
#define APIEIGER 0x190830
|
|
||||||
#define APIGOTTHARD2 0x190902
|
#define APIGOTTHARD2 0x190902
|
||||||
|
#define APIEIGER 0x190902
|
||||||
|
#define APIJUNGFRAU 0x190902
|
||||||
|
#define APICTB 0x190902
|
||||||
|
@ -17,18 +17,24 @@ cd $API_DIR
|
|||||||
NUM=$(sed -n '/'$API_NAME' /=' $API_FILE)
|
NUM=$(sed -n '/'$API_NAME' /=' $API_FILE)
|
||||||
#echo $NUM
|
#echo $NUM
|
||||||
|
|
||||||
|
|
||||||
if [ "$NUM" -gt 0 ]; then
|
if [ "$NUM" -gt 0 ]; then
|
||||||
sed -i ${NUM}d $API_FILE
|
sed -i ${NUM}d $API_FILE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#find new API date
|
#find new API date
|
||||||
API_DATE="find . -printf \"%T@ %CY-%Cm-%CdT%CH:%CM:%CS %p\n\"| sort -nr | cut -d' ' -f2- | egrep -v build | egrep -v '(\.)o'| egrep -v 'versionAPI.h' | head -n 1"
|
API_DATE="find . -printf \"%T@ %CY-%Cm-%Cd\n\"| sort -nr | cut -d' ' -f2- | egrep -v '(\.)o' | head -n 1"
|
||||||
|
|
||||||
API_DATE=`eval $API_DATE`
|
API_DATE=`eval $API_DATE`
|
||||||
|
|
||||||
API_DATE=$(sed "s/-//g" <<< $API_DATE | awk '{print $1;}' )
|
API_DATE=$(sed "s/-//g" <<< $API_DATE | awk '{print $1;}' )
|
||||||
|
|
||||||
#extracting only date
|
#extracting only date
|
||||||
API_DATE=${API_DATE:2:6}
|
API_DATE=${API_DATE:2:6}
|
||||||
|
|
||||||
#prefix of 0x
|
#prefix of 0x
|
||||||
API_DATE=${API_DATE/#/0x}
|
API_DATE=${API_DATE/#/0x}
|
||||||
|
echo "date="$API_DATE
|
||||||
|
|
||||||
#copy it to versionAPI.h
|
#copy it to versionAPI.h
|
||||||
echo "#define "$API_NAME $API_DATE >> $API_FILE
|
echo "#define "$API_NAME $API_DATE >> $API_FILE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user