mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 00:00:02 +02:00
ctb:separated analog and digital samples in server and send analog and digital data packed separately per frame to reciever
This commit is contained in:
parent
b0cffcd570
commit
2f3b0e0b06
@ -429,6 +429,11 @@
|
|||||||
/* Samples RW register */
|
/* Samples RW register */
|
||||||
#define SAMPLES_REG (0x5D << MEM_MAP_SHIFT)
|
#define SAMPLES_REG (0x5D << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
#define SAMPLES_DIGITAL_OFST (0)
|
||||||
|
#define SAMPLES_DIGITAL_MSK (0x0000FFFF << SAMPLES_DIGITAL_OFST)
|
||||||
|
#define SAMPLES_ANALOG_OFST (16)
|
||||||
|
#define SAMPLES_ANALOG_MSK (0x0000FFFF << SAMPLES_ANALOG_OFST)
|
||||||
|
|
||||||
/** Power RW register */
|
/** Power RW register */
|
||||||
#define POWER_REG (0x5E << MEM_MAP_SHIFT)
|
#define POWER_REG (0x5E << MEM_MAP_SHIFT)
|
||||||
|
|
||||||
|
@ -39,7 +39,13 @@ int virtual_stop = 0;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int dataBytes = 0;
|
int dataBytes = 0;
|
||||||
char* ramValues = 0;
|
int analogDataBytes = 0;
|
||||||
|
int digitalDataBytes = 0;
|
||||||
|
char* analogData = 0;
|
||||||
|
char* digitalData = 0;
|
||||||
|
char volatile *analogDataPtr = 0;
|
||||||
|
char volatile *digitalDataPtr = 0;
|
||||||
|
|
||||||
char udpPacketData[UDP_PACKET_DATA_BYTES + sizeof(sls_detector_header)];
|
char udpPacketData[UDP_PACKET_DATA_BYTES + sizeof(sls_detector_header)];
|
||||||
|
|
||||||
int32_t clkPhase[NUM_CLOCKS] = {0, 0, 0, 0};
|
int32_t clkPhase[NUM_CLOCKS] = {0, 0, 0, 0};
|
||||||
@ -53,8 +59,9 @@ int highvoltage = 0;
|
|||||||
uint32_t adcEnableMask = 0;
|
uint32_t adcEnableMask = 0;
|
||||||
int analogEnable = 1;
|
int analogEnable = 1;
|
||||||
int digitalEnable = 0;
|
int digitalEnable = 0;
|
||||||
int nSamples = 1;
|
int naSamples = 1;
|
||||||
char volatile *now_ptr = 0;
|
int ndSamples = 1;
|
||||||
|
|
||||||
|
|
||||||
int isFirmwareCheckDone() {
|
int isFirmwareCheckDone() {
|
||||||
return firmware_check_done;
|
return firmware_check_done;
|
||||||
@ -454,10 +461,18 @@ void setupDetector() {
|
|||||||
|
|
||||||
// default variables
|
// default variables
|
||||||
dataBytes = 0;
|
dataBytes = 0;
|
||||||
if (ramValues) {
|
analogDataBytes = 0;
|
||||||
free(ramValues);
|
digitalDataBytes = 0;
|
||||||
ramValues = 0;
|
if (analogData) {
|
||||||
|
free(analogData);
|
||||||
|
analogData = 0;
|
||||||
}
|
}
|
||||||
|
if (digitalData) {
|
||||||
|
free(digitalData);
|
||||||
|
digitalData = 0;
|
||||||
|
}
|
||||||
|
analogDataPtr = 0;
|
||||||
|
digitalDataPtr = 0;
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (i = 0; i < NUM_CLOCKS; ++i) {
|
for (i = 0; i < NUM_CLOCKS; ++i) {
|
||||||
@ -475,8 +490,8 @@ void setupDetector() {
|
|||||||
adcEnableMask = BIT_32_MSK;
|
adcEnableMask = BIT_32_MSK;
|
||||||
analogEnable = 1;
|
analogEnable = 1;
|
||||||
digitalEnable = 0;
|
digitalEnable = 0;
|
||||||
nSamples = 1;
|
naSamples = 1;
|
||||||
now_ptr = 0;
|
ndSamples = 1;
|
||||||
|
|
||||||
|
|
||||||
ALTERA_PLL_ResetPLLAndReconfiguration();
|
ALTERA_PLL_ResetPLLAndReconfiguration();
|
||||||
@ -538,7 +553,8 @@ void setupDetector() {
|
|||||||
enableTenGigabitEthernet(0);
|
enableTenGigabitEthernet(0);
|
||||||
|
|
||||||
//Initialization of acquistion parameters
|
//Initialization of acquistion parameters
|
||||||
setTimer(SAMPLES, DEFAULT_NUM_SAMPLES); // update databytes and allocate ram
|
setTimer(ANALOG_SAMPLES, DEFAULT_NUM_SAMPLES);
|
||||||
|
setTimer(DIGITAL_SAMPLES, DEFAULT_NUM_SAMPLES); // update databytes and allocate ram
|
||||||
setTimer(FRAME_NUMBER, DEFAULT_NUM_FRAMES);
|
setTimer(FRAME_NUMBER, DEFAULT_NUM_FRAMES);
|
||||||
setTimer(ACQUISITION_TIME, DEFAULT_EXPTIME);
|
setTimer(ACQUISITION_TIME, DEFAULT_EXPTIME);
|
||||||
setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES);
|
setTimer(CYCLES_NUMBER, DEFAULT_NUM_CYCLES);
|
||||||
@ -552,7 +568,8 @@ void setupDetector() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int allocateRAM() {
|
int allocateRAM() {
|
||||||
int oldDataBytes = dataBytes;
|
int oldAnalogDataBytes = analogDataBytes;
|
||||||
|
int oldDigitalDataBytes = digitalDataBytes;
|
||||||
updateDataBytes();
|
updateDataBytes();
|
||||||
|
|
||||||
// only allcoate RAM for 1 giga udp (if 10G, return)
|
// only allcoate RAM for 1 giga udp (if 10G, return)
|
||||||
@ -561,59 +578,82 @@ int allocateRAM() {
|
|||||||
|
|
||||||
|
|
||||||
// update only if change in databytes
|
// update only if change in databytes
|
||||||
if (dataBytes == oldDataBytes) {
|
if (analogDataBytes == oldAnalogDataBytes && digitalDataBytes == oldDigitalDataBytes) {
|
||||||
FILE_LOG(logDEBUG1, ("RAM of size %d already allocated. Nothing to be done.\n", dataBytes));
|
FILE_LOG(logDEBUG1, ("RAM size (Analog:%d, Digital:%d) already allocated. Nothing to be done.\n",
|
||||||
|
analogDataBytes, digitalDataBytes));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
// Zero databytes
|
// Zero databytes
|
||||||
if (dataBytes <= 0) {
|
if (analogDataBytes == 0 && digitalDataBytes == 0) {
|
||||||
FILE_LOG(logERROR, ("Can not allocate RAM for 0 bytes (databytes: 0).\n"));
|
FILE_LOG(logERROR, ("Can not allocate RAM for 0 bytes.\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
// clear RAM
|
// clear RAM
|
||||||
if (ramValues) {
|
if (analogData) {
|
||||||
free(ramValues);
|
free(analogData);
|
||||||
ramValues = 0;
|
analogData = 0;
|
||||||
|
}
|
||||||
|
if (digitalData) {
|
||||||
|
free(digitalData);
|
||||||
|
digitalData = 0;
|
||||||
}
|
}
|
||||||
// allocate RAM
|
// allocate RAM
|
||||||
ramValues = malloc(dataBytes);
|
if (analogDataBytes) {
|
||||||
|
analogData = malloc(analogDataBytes);
|
||||||
// cannot malloc
|
// cannot malloc
|
||||||
if (ramValues == NULL) {
|
if (analogData == NULL) {
|
||||||
FILE_LOG(logERROR, ("Can not allocate RAM for even 1 frame. "
|
FILE_LOG(logERROR, ("Can not allocate analog data RAM for even 1 frame. "
|
||||||
"Probably cause: Memory Leak.\n"));
|
"Probable cause: Memory Leak.\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
FILE_LOG(logINFO, ("\tAnalog RAM allocated to %d bytes\n", analogDataBytes));
|
||||||
|
}
|
||||||
|
if (digitalDataBytes) {
|
||||||
|
digitalData = malloc(digitalDataBytes);
|
||||||
|
// cannot malloc
|
||||||
|
if (digitalData == NULL) {
|
||||||
|
FILE_LOG(logERROR, ("Can not allocate digital data RAM for even 1 frame. "
|
||||||
|
"Probable cause: Memory Leak.\n"));
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FILE_LOG(logINFO, ("\tRAM allocated to %d bytes\n", dataBytes));
|
|
||||||
|
FILE_LOG(logINFO, ("\tDigital RAM allocated to %d bytes\n", digitalDataBytes));
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateDataBytes() {
|
void updateDataBytes() {
|
||||||
int oldDataBytes = dataBytes;
|
int nachans = 0, ndchans = 0;
|
||||||
dataBytes = NCHIP * getChannels() * NUM_BYTES_PER_PIXEL * nSamples;
|
analogDataBytes = 0;
|
||||||
if (dataBytes != oldDataBytes) {
|
digitalDataBytes = 0;
|
||||||
FILE_LOG(logINFO, ("\tUpdating Databytes: %d\n", dataBytes));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int getChannels() {
|
|
||||||
int nchans = 0;
|
|
||||||
|
|
||||||
|
// analog
|
||||||
if (analogEnable) {
|
if (analogEnable) {
|
||||||
if (adcEnableMask == BIT_32_MSK)
|
if (adcEnableMask == BIT_32_MSK)
|
||||||
nchans = 32;
|
nachans = 32;
|
||||||
else {
|
else {
|
||||||
int ichan = 0;
|
int ichan = 0;
|
||||||
for (ichan = 0; ichan < NCHAN_ANALOG; ++ichan) {
|
for (ichan = 0; ichan < NCHAN_ANALOG; ++ichan) {
|
||||||
if (adcEnableMask & (1 << ichan))
|
if (adcEnableMask & (1 << ichan))
|
||||||
++nchans;
|
++nachans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
analogDataBytes = nachans * (DYNAMIC_RANGE / 8) * naSamples;
|
||||||
|
FILE_LOG(logINFO, ("\t#Analog Channels:%d, Databytes:%d\n", nachans, analogDataBytes));
|
||||||
}
|
}
|
||||||
if (digitalEnable)
|
// digital
|
||||||
nchans += NCHAN_DIGITAL;
|
if (digitalEnable) {
|
||||||
FILE_LOG(logINFO, ("\tNumber of Channels calculated: %d\n", nchans))
|
ndchans = NCHAN_DIGITAL;
|
||||||
return nchans;
|
digitalDataBytes = (sizeof(uint64_t) * ndSamples);
|
||||||
|
FILE_LOG(logINFO, ("\t#Digital Channels:%d, Databytes:%d\n", ndchans, digitalDataBytes));
|
||||||
|
}
|
||||||
|
|
||||||
|
// total
|
||||||
|
int nchans = nachans + ndchans;
|
||||||
|
dataBytes = analogDataBytes + digitalDataBytes;
|
||||||
|
|
||||||
|
FILE_LOG(logINFO, ("\t#Total Channels:%d, Total Databytes:%d\n", nchans, dataBytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -845,17 +885,33 @@ int64_t setTimer(enum timerIndex ind, int64_t val) {
|
|||||||
FILE_LOG(logINFO, ("\tGetting #cycles: %lld\n", (long long int)retval));
|
FILE_LOG(logINFO, ("\tGetting #cycles: %lld\n", (long long int)retval));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
if(val >= 0) {
|
if(val >= 0) {
|
||||||
FILE_LOG(logINFO, ("Setting #samples: %lld\n", (long long int)val));
|
FILE_LOG(logINFO, ("Setting #analog samples: %lld\n", (long long int)val));
|
||||||
nSamples = val;
|
naSamples = val;
|
||||||
bus_w(SAMPLES_REG, val);
|
bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) &~ SAMPLES_ANALOG_MSK);
|
||||||
|
bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) | ((val << SAMPLES_ANALOG_OFST) & SAMPLES_ANALOG_MSK));
|
||||||
if (allocateRAM() == FAIL) {
|
if (allocateRAM() == FAIL) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
retval = nSamples;
|
retval = naSamples;
|
||||||
FILE_LOG(logINFO, ("\tGetting #samples: %lld\n", (long long int)retval));
|
FILE_LOG(logINFO, ("\tGetting #analog samples: %lld\n", (long long int)retval));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
|
if(val >= 0) {
|
||||||
|
FILE_LOG(logINFO, ("Setting #digital samples: %lld\n", (long long int)val));
|
||||||
|
ndSamples = val;
|
||||||
|
bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) &~ SAMPLES_DIGITAL_MSK);
|
||||||
|
bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) | ((val << SAMPLES_DIGITAL_OFST) & SAMPLES_DIGITAL_MSK));
|
||||||
|
|
||||||
|
if (allocateRAM() == FAIL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
retval = ndSamples;
|
||||||
|
FILE_LOG(logINFO, ("\tGetting #digital samples: %lld\n", (long long int)retval));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -2242,7 +2298,7 @@ void readSample(int ns) {
|
|||||||
uint32_t addr = DUMMY_REG;
|
uint32_t addr = DUMMY_REG;
|
||||||
|
|
||||||
// read adcs
|
// read adcs
|
||||||
if (analogEnable) {
|
if (analogEnable && ns < naSamples) {
|
||||||
|
|
||||||
uint32_t fifoAddr = FIFO_DATA_REG;
|
uint32_t fifoAddr = FIFO_DATA_REG;
|
||||||
|
|
||||||
@ -2259,7 +2315,7 @@ void readSample(int ns) {
|
|||||||
|
|
||||||
if (!(ns%1000)) {
|
if (!(ns%1000)) {
|
||||||
FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d AEmtpy:0x%x AFull:0x%x Status:0x%x\n",
|
FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d AEmtpy:0x%x AFull:0x%x Status:0x%x\n",
|
||||||
ns, nSamples, bus_r(FIFO_EMPTY_REG), bus_r(FIFO_FULL_REG), bus_r(STATUS_REG)));
|
ns, naSamples, bus_r(FIFO_EMPTY_REG), bus_r(FIFO_FULL_REG), bus_r(STATUS_REG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop through all channels
|
// loop through all channels
|
||||||
@ -2276,22 +2332,22 @@ void readSample(int ns) {
|
|||||||
bus_w(addr, bus_r(addr) | ((ich << DUMMY_FIFO_CHNNL_SLCT_OFST) & DUMMY_FIFO_CHNNL_SLCT_MSK));
|
bus_w(addr, bus_r(addr) | ((ich << DUMMY_FIFO_CHNNL_SLCT_OFST) & DUMMY_FIFO_CHNNL_SLCT_MSK));
|
||||||
|
|
||||||
// read fifo and write it to current position of data pointer
|
// read fifo and write it to current position of data pointer
|
||||||
*((uint16_t*)now_ptr) = bus_r16(fifoAddr);
|
*((uint16_t*)analogDataPtr) = bus_r16(fifoAddr);
|
||||||
|
|
||||||
// keep reading till the value is the same
|
// keep reading till the value is the same
|
||||||
/* while (*((uint16_t*)now_ptr) != bus_r16(fifoAddr)) {
|
/* while (*((uint16_t*)analogDataPtr) != bus_r16(fifoAddr)) {
|
||||||
FILE_LOG(logDEBUG1, ("%d ", ich));
|
FILE_LOG(logDEBUG1, ("%d ", ich));
|
||||||
*((uint16_t*)now_ptr) = bus_r16(fifoAddr);
|
*((uint16_t*)analogDataPtr) = bus_r16(fifoAddr);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// increment pointer to data out destination
|
// increment pointer to data out destination
|
||||||
now_ptr += 2;
|
analogDataPtr += 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// read digital output
|
// read digital output
|
||||||
if (digitalEnable) {
|
if (digitalEnable && ns < ndSamples) {
|
||||||
// read strobe to digital fifo
|
// read strobe to digital fifo
|
||||||
bus_w(addr, bus_r(addr) | DUMMY_DGTL_FIFO_RD_STRBE_MSK);
|
bus_w(addr, bus_r(addr) | DUMMY_DGTL_FIFO_RD_STRBE_MSK);
|
||||||
bus_w(addr, bus_r(addr) & (~DUMMY_DGTL_FIFO_RD_STRBE_MSK));
|
bus_w(addr, bus_r(addr) & (~DUMMY_DGTL_FIFO_RD_STRBE_MSK));
|
||||||
@ -2306,15 +2362,15 @@ void readSample(int ns) {
|
|||||||
// wait as it is connected directly to fifo running on a different clock
|
// wait as it is connected directly to fifo running on a different clock
|
||||||
if (!(ns%1000)) {
|
if (!(ns%1000)) {
|
||||||
FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d DEmtpy:%d DFull:%d Status:0x%x\n",
|
FILE_LOG(logDEBUG1, ("Reading sample ns:%d of %d DEmtpy:%d DFull:%d Status:0x%x\n",
|
||||||
ns, nSamples,
|
ns, ndSamples,
|
||||||
((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_EMPTY_MSK) >> FIFO_DIN_STATUS_FIFO_EMPTY_OFST),
|
((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_EMPTY_MSK) >> FIFO_DIN_STATUS_FIFO_EMPTY_OFST),
|
||||||
((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_FULL_MSK) >> FIFO_DIN_STATUS_FIFO_FULL_OFST),
|
((bus_r(FIFO_DIN_STATUS_REG) & FIFO_DIN_STATUS_FIFO_FULL_MSK) >> FIFO_DIN_STATUS_FIFO_FULL_OFST),
|
||||||
bus_r(STATUS_REG)));
|
bus_r(STATUS_REG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// read fifo and write it to current position of data pointer
|
// read fifo and write it to current position of data pointer
|
||||||
*((uint64_t*)now_ptr) = get64BitReg(FIFO_DIN_LSB_REG, FIFO_DIN_MSB_REG);
|
*((uint64_t*)digitalDataPtr) = get64BitReg(FIFO_DIN_LSB_REG, FIFO_DIN_MSB_REG);
|
||||||
now_ptr += 8;
|
digitalDataPtr += 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2334,7 +2390,7 @@ uint32_t checkDataInFifo() {
|
|||||||
return dataPresent;
|
return dataPresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only called for first sample
|
// only called for starting of a new frame
|
||||||
int checkFifoForEndOfAcquisition() {
|
int checkFifoForEndOfAcquisition() {
|
||||||
uint32_t dataPresent = checkDataInFifo();
|
uint32_t dataPresent = checkDataInFifo();
|
||||||
FILE_LOG(logDEBUG2, ("status:0x%x\n", bus_r(STATUS_REG)));
|
FILE_LOG(logDEBUG2, ("status:0x%x\n", bus_r(STATUS_REG)));
|
||||||
@ -2367,7 +2423,8 @@ int checkFifoForEndOfAcquisition() {
|
|||||||
int readFrameFromFifo() {
|
int readFrameFromFifo() {
|
||||||
int ns = 0;
|
int ns = 0;
|
||||||
// point the data pointer to the starting position of data
|
// point the data pointer to the starting position of data
|
||||||
now_ptr = ramValues;
|
analogDataPtr = analogData;
|
||||||
|
digitalDataPtr = digitalData;
|
||||||
|
|
||||||
// no data for this frame
|
// no data for this frame
|
||||||
if (checkFifoForEndOfAcquisition() == FAIL) {
|
if (checkFifoForEndOfAcquisition() == FAIL) {
|
||||||
@ -2375,7 +2432,8 @@ int readFrameFromFifo() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// read Sample
|
// read Sample
|
||||||
while(ns < nSamples) {
|
int maxSamples = (naSamples > ndSamples) ? naSamples : ndSamples;
|
||||||
|
while(ns < maxSamples) {
|
||||||
// chceck if no data in fifo, return ns?//FIXME: ask Anna
|
// chceck if no data in fifo, return ns?//FIXME: ask Anna
|
||||||
readSample(ns);
|
readSample(ns);
|
||||||
ns++;
|
ns++;
|
||||||
|
@ -32,7 +32,7 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
|
|||||||
/* Hardware Definitions */
|
/* Hardware Definitions */
|
||||||
#define NCHAN (36)
|
#define NCHAN (36)
|
||||||
#define NCHAN_ANALOG (32)
|
#define NCHAN_ANALOG (32)
|
||||||
#define NCHAN_DIGITAL (4)
|
#define NCHAN_DIGITAL (64)
|
||||||
#define NCHIP (1)
|
#define NCHIP (1)
|
||||||
#define NDAC (24)
|
#define NDAC (24)
|
||||||
#define NPWR (6)
|
#define NPWR (6)
|
||||||
|
@ -574,27 +574,12 @@ int allocateRAM() {
|
|||||||
|
|
||||||
void updateDataBytes() {
|
void updateDataBytes() {
|
||||||
int oldDataBytes = dataBytes;
|
int oldDataBytes = dataBytes;
|
||||||
dataBytes = NCHIP * getChannels() * NUM_BYTES_PER_PIXEL * nSamples;
|
dataBytes = NCHIP * NUM_BYTES_PER_PIXEL * nSamples;
|
||||||
if (dataBytes != oldDataBytes) {
|
if (dataBytes != oldDataBytes) {
|
||||||
FILE_LOG(logINFO, ("\tUpdating Databytes: %d\n", dataBytes));
|
FILE_LOG(logINFO, ("\tUpdating Databytes: %d\n", dataBytes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int getChannels() {
|
|
||||||
int nchans = 0;
|
|
||||||
|
|
||||||
nchans += NCHAN;
|
|
||||||
// remove the channels disabled
|
|
||||||
int ichan = 0;
|
|
||||||
for (ichan = 0; ichan < NCHAN; ++ichan) {
|
|
||||||
if (adcDisableMask & (1 << ichan))
|
|
||||||
--nchans;
|
|
||||||
}
|
|
||||||
|
|
||||||
FILE_LOG(logINFO, ("\tNumber of Channels calculated: %d\n", nchans))
|
|
||||||
return nchans;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* firmware functions (resets) */
|
/* firmware functions (resets) */
|
||||||
|
|
||||||
|
@ -15,22 +15,20 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
extern const enum detectorType myDetectorType;
|
|
||||||
extern int nSamples;
|
|
||||||
extern int dataBytes;
|
|
||||||
extern int nframes;
|
|
||||||
extern char* ramValues;
|
|
||||||
|
|
||||||
#define UDP_PACKET_HEADER_VERSION (0x1)
|
#define UDP_PACKET_HEADER_VERSION (0x1)
|
||||||
|
|
||||||
|
extern const enum detectorType myDetectorType;
|
||||||
|
|
||||||
|
extern int analogDataBytes;
|
||||||
|
extern int digitalDataBytes;
|
||||||
|
extern char* analogData;
|
||||||
|
extern char* digitalData;
|
||||||
|
|
||||||
|
int analogOffset = 0;
|
||||||
|
int digitalOffset = 0;
|
||||||
uint32_t udpPacketNumber = 0;
|
uint32_t udpPacketNumber = 0;
|
||||||
uint64_t udpFrameNumber = 0;
|
uint64_t udpFrameNumber = 0;
|
||||||
|
|
||||||
int numSamplesPerPacket = 0;
|
|
||||||
int dataBytesPerSample = 0;
|
|
||||||
int dataBytesPerPacket = 0;
|
|
||||||
int udpHeaderOffset = 0;
|
|
||||||
|
|
||||||
uint32_t getUDPPacketNumber() {
|
uint32_t getUDPPacketNumber() {
|
||||||
return udpPacketNumber;
|
return udpPacketNumber;
|
||||||
@ -56,25 +54,28 @@ void createUDPPacketHeader(char* buffer, uint16_t id) {
|
|||||||
header->version = UDP_PACKET_HEADER_VERSION;
|
header->version = UDP_PACKET_HEADER_VERSION;
|
||||||
|
|
||||||
// reset offset
|
// reset offset
|
||||||
udpHeaderOffset = 0;
|
analogOffset = 0;
|
||||||
|
digitalOffset = 0;
|
||||||
// reset frame number
|
// reset frame number
|
||||||
udpFrameNumber = 0;
|
udpFrameNumber = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int fillUDPPacket(char* buffer) {
|
int fillUDPPacket(char* buffer) {
|
||||||
FILE_LOG(logDEBUG2, ("Databytes:%d offset:%d\n", dataBytes, udpHeaderOffset));
|
FILE_LOG(logDEBUG2, ("Analog (databytes:%d, offset:%d)\n Digital (databytes:%d offset:%d)\n",
|
||||||
|
analogDataBytes, analogOffset, digitalDataBytes, digitalOffset));
|
||||||
// reached end of data for one frame
|
// reached end of data for one frame
|
||||||
if (udpHeaderOffset >= dataBytes) {
|
if (analogOffset >= analogDataBytes && digitalOffset >= digitalDataBytes) {
|
||||||
// reset offset
|
// reset offset
|
||||||
udpHeaderOffset = 0;
|
analogOffset = 0;
|
||||||
|
digitalOffset = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
sls_detector_header* header = (sls_detector_header*)(buffer);
|
sls_detector_header* header = (sls_detector_header*)(buffer);
|
||||||
|
|
||||||
// update frame number, starts at 1 (reset packet number)
|
// update frame number, starts at 1 (reset packet number)
|
||||||
if (udpHeaderOffset == 0) {
|
if (analogOffset == 0 && digitalOffset == 0) {
|
||||||
++udpFrameNumber;
|
++udpFrameNumber;
|
||||||
header->frameNumber = udpFrameNumber;
|
header->frameNumber = udpFrameNumber;
|
||||||
udpPacketNumber = -1;
|
udpPacketNumber = -1;
|
||||||
@ -85,21 +86,41 @@ int fillUDPPacket(char* buffer) {
|
|||||||
header->packetNumber = udpPacketNumber;
|
header->packetNumber = udpPacketNumber;
|
||||||
FILE_LOG(logDEBUG2, ("Creating packet number %d (fnum:%lld)\n", udpPacketNumber, (long long int) udpFrameNumber));
|
FILE_LOG(logDEBUG2, ("Creating packet number %d (fnum:%lld)\n", udpPacketNumber, (long long int) udpFrameNumber));
|
||||||
|
|
||||||
// calculate number of bytes to copy
|
int freeBytes = UDP_PACKET_DATA_BYTES;
|
||||||
int numBytesToCopy = ((udpHeaderOffset + UDP_PACKET_DATA_BYTES) <= dataBytes) ?
|
|
||||||
UDP_PACKET_DATA_BYTES : (dataBytes - udpHeaderOffset);
|
|
||||||
|
|
||||||
// copy data
|
// analog data
|
||||||
memcpy(buffer + sizeof(sls_detector_header), ramValues + udpHeaderOffset, numBytesToCopy);
|
int analogBytes = 0;
|
||||||
// pad last packet if extra space
|
if (analogOffset < analogDataBytes) {
|
||||||
if (numBytesToCopy < UDP_PACKET_DATA_BYTES) {
|
// bytes to copy
|
||||||
int bytes = UDP_PACKET_DATA_BYTES - numBytesToCopy;
|
analogBytes = ((analogOffset + freeBytes) <= analogDataBytes) ?
|
||||||
FILE_LOG(logDEBUG1, ("Padding %d bytes for fnum:%lld pnum:%d\n", bytes, (long long int)udpFrameNumber, udpPacketNumber));
|
freeBytes : (analogDataBytes - analogOffset);
|
||||||
memset(buffer + sizeof(sls_detector_header) + numBytesToCopy, 0, bytes);
|
// copy
|
||||||
|
memcpy(buffer + sizeof(sls_detector_header), analogData + analogOffset, analogBytes);
|
||||||
|
// increment offset
|
||||||
|
analogOffset += analogBytes;
|
||||||
|
// decrement free bytes
|
||||||
|
freeBytes -= analogBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// digital data
|
||||||
|
int digitalBytes = 0;
|
||||||
|
if (freeBytes && digitalOffset < digitalDataBytes) {
|
||||||
|
// bytes to copy
|
||||||
|
digitalBytes = ((digitalOffset + freeBytes) <= digitalDataBytes) ?
|
||||||
|
freeBytes : (digitalDataBytes - digitalOffset);
|
||||||
|
// copy
|
||||||
|
memcpy(buffer + sizeof(sls_detector_header) + analogBytes, digitalData + digitalOffset, digitalBytes);
|
||||||
// increment offset
|
// increment offset
|
||||||
udpHeaderOffset += numBytesToCopy;
|
digitalOffset += digitalBytes;
|
||||||
|
// decrement free bytes
|
||||||
|
freeBytes -= digitalBytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// pad data
|
||||||
|
if (freeBytes) {
|
||||||
|
memset(buffer + sizeof(sls_detector_header) + analogBytes + digitalBytes, 0, freeBytes);
|
||||||
|
FILE_LOG(logDEBUG1, ("Padding %d bytes for fnum:%lld pnum:%d\n", freeBytes, (long long int)udpFrameNumber, udpPacketNumber));
|
||||||
|
}
|
||||||
|
|
||||||
return UDP_PACKET_DATA_BYTES + sizeof(sls_detector_header);
|
return UDP_PACKET_DATA_BYTES + sizeof(sls_detector_header);
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,6 @@ void setupDetector();
|
|||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
int allocateRAM();
|
int allocateRAM();
|
||||||
void updateDataBytes();
|
void updateDataBytes();
|
||||||
int getChannels();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GOTTHARDD) || defined(JUNGFRAUD)
|
#if defined(GOTTHARDD) || defined(JUNGFRAUD)
|
||||||
|
@ -124,7 +124,8 @@ const char* getTimerName(enum timerIndex ind) {
|
|||||||
case MEASUREMENTS_NUMBER: return "measurements_number";
|
case MEASUREMENTS_NUMBER: return "measurements_number";
|
||||||
case FRAMES_FROM_START: return "frames_from_start";
|
case FRAMES_FROM_START: return "frames_from_start";
|
||||||
case FRAMES_FROM_START_PG: return "frames_from_start_pg";
|
case FRAMES_FROM_START_PG: return "frames_from_start_pg";
|
||||||
case SAMPLES: return "samples";
|
case ANALOG_SAMPLES: return "analog_samples";
|
||||||
|
case DIGITAL_SAMPLES: return "digital_samples";
|
||||||
case SUBFRAME_ACQUISITION_TIME: return "subframe_acquisition_time";
|
case SUBFRAME_ACQUISITION_TIME: return "subframe_acquisition_time";
|
||||||
case SUBFRAME_DEADTIME: return "subframe_deadtime";
|
case SUBFRAME_DEADTIME: return "subframe_deadtime";
|
||||||
case STORAGE_CELL_NUMBER: return "storage_cell_number";
|
case STORAGE_CELL_NUMBER: return "storage_cell_number";
|
||||||
@ -1581,7 +1582,8 @@ int set_timer(int file_des) {
|
|||||||
case FRAME_PERIOD:
|
case FRAME_PERIOD:
|
||||||
case CYCLES_NUMBER:
|
case CYCLES_NUMBER:
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
#endif
|
#endif
|
||||||
#ifndef EIGERD
|
#ifndef EIGERD
|
||||||
case DELAY_AFTER_TRIGGER:
|
case DELAY_AFTER_TRIGGER:
|
||||||
@ -1652,12 +1654,13 @@ int set_timer(int file_des) {
|
|||||||
case STORAGE_CELL_NUMBER:
|
case STORAGE_CELL_NUMBER:
|
||||||
validate64(tns, retval, vtimerName, DEC); // no conversion, so all good
|
validate64(tns, retval, vtimerName, DEC); // no conversion, so all good
|
||||||
break;
|
break;
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
if (retval == -1) {
|
if (retval == -1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
retval = setTimer(ind, -1);
|
retval = setTimer(ind, -1);
|
||||||
sprintf(mess, "Could not set samples to %lld. Could not allocate RAM\n",
|
sprintf(mess, "Could not %s to %lld. Could not allocate RAM\n",
|
||||||
(long long unsigned int)tns);
|
vtimerName, (long long unsigned int)tns);
|
||||||
FILE_LOG(logERROR,(mess));
|
FILE_LOG(logERROR,(mess));
|
||||||
} else
|
} else
|
||||||
validate64(tns, retval, vtimerName, DEC); // no conversion, so all good
|
validate64(tns, retval, vtimerName, DEC); // no conversion, so all good
|
||||||
@ -2258,12 +2261,18 @@ int send_update(int file_des) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #samples, adcmask
|
|
||||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||||
i64 = setTimer(SAMPLES,GET_FLAG);
|
// #analog samples
|
||||||
|
i64 = setTimer(ANALOG_SAMPLES,GET_FLAG);
|
||||||
n = sendData(file_des,&i64,sizeof(i64),INT64);
|
n = sendData(file_des,&i64,sizeof(i64),INT64);
|
||||||
if (n < 0) return printSocketReadError();
|
if (n < 0) return printSocketReadError();
|
||||||
|
|
||||||
|
// #digital samples
|
||||||
|
i64 = setTimer(DIGITAL_SAMPLES,GET_FLAG);
|
||||||
|
n = sendData(file_des,&i64,sizeof(i64),INT64);
|
||||||
|
if (n < 0) return printSocketReadError();
|
||||||
|
|
||||||
|
// adcmask
|
||||||
i32 = getADCEnableMask();
|
i32 = getADCEnableMask();
|
||||||
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();
|
||||||
|
@ -284,7 +284,8 @@ void multiSlsDetector::initSharedMemory(bool verify) {
|
|||||||
<< ") version mismatch "
|
<< ") version mismatch "
|
||||||
"(expected 0x"
|
"(expected 0x"
|
||||||
<< std::hex << MULTI_SHMVERSION << " but got 0x"
|
<< std::hex << MULTI_SHMVERSION << " but got 0x"
|
||||||
<< multi_shm()->shmversion << std::dec;
|
<< multi_shm()->shmversion << std::dec
|
||||||
|
<< ". Clear Shared memory to continue.";
|
||||||
throw SharedMemoryError("Shared memory version mismatch!");
|
throw SharedMemoryError("Shared memory version mismatch!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1080,10 +1081,6 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int detPos) {
|
|||||||
auto r = parallelCall(&slsDetector::setTimer, index, t);
|
auto r = parallelCall(&slsDetector::setTimer, index, t);
|
||||||
int64_t ret = sls::minusOneIfDifferent(r);
|
int64_t ret = sls::minusOneIfDifferent(r);
|
||||||
|
|
||||||
if (index == SAMPLES) {
|
|
||||||
setDynamicRange();
|
|
||||||
}
|
|
||||||
|
|
||||||
// set progress
|
// set progress
|
||||||
if (t != -1) {
|
if (t != -1) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
@ -281,7 +281,7 @@ void slsDetector::initSharedMemory(detectorType type, int multi_id,
|
|||||||
ss << "Single shared memory (" << multi_id << "-" << detId
|
ss << "Single shared memory (" << multi_id << "-" << detId
|
||||||
<< ":) version mismatch (expected 0x" << std::hex
|
<< ":) version mismatch (expected 0x" << std::hex
|
||||||
<< SLS_SHMVERSION << " but got 0x" << shm()->shmversion << ")"
|
<< SLS_SHMVERSION << " but got 0x" << shm()->shmversion << ")"
|
||||||
<< std::dec;
|
<< std::dec << ". Clear Shared memory to continue.";
|
||||||
throw SharedMemoryError(ss.str());
|
throw SharedMemoryError(ss.str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -322,7 +322,8 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
shm()->timerValue[MEASUREMENTS_NUMBER] = 1;
|
shm()->timerValue[MEASUREMENTS_NUMBER] = 1;
|
||||||
shm()->timerValue[FRAMES_FROM_START] = 0;
|
shm()->timerValue[FRAMES_FROM_START] = 0;
|
||||||
shm()->timerValue[FRAMES_FROM_START_PG] = 0;
|
shm()->timerValue[FRAMES_FROM_START_PG] = 0;
|
||||||
shm()->timerValue[SAMPLES] = 1;
|
shm()->timerValue[ANALOG_SAMPLES] = 1;
|
||||||
|
shm()->timerValue[DIGITAL_SAMPLES] = 1;
|
||||||
shm()->timerValue[SUBFRAME_ACQUISITION_TIME] = 0;
|
shm()->timerValue[SUBFRAME_ACQUISITION_TIME] = 0;
|
||||||
shm()->timerValue[STORAGE_CELL_NUMBER] = 0;
|
shm()->timerValue[STORAGE_CELL_NUMBER] = 0;
|
||||||
shm()->timerValue[SUBFRAME_DEADTIME] = 0;
|
shm()->timerValue[SUBFRAME_DEADTIME] = 0;
|
||||||
@ -418,10 +419,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
|
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans and databytes, as it depends on #samples, adcmask,
|
||||||
// readoutflags (ctb only)
|
// readoutflags (ctb only)
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
|
||||||
shm()->myDetectorType == MOENCH) {
|
|
||||||
updateTotalNumberOfChannels();
|
updateTotalNumberOfChannels();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int slsDetector::sendModule(sls_detector_module *myMod,
|
int slsDetector::sendModule(sls_detector_module *myMod,
|
||||||
@ -519,7 +517,8 @@ slsDetectorDefs::detectorType slsDetector::getDetectorTypeFromShm(int multi_id,
|
|||||||
std::ostringstream ss;
|
std::ostringstream ss;
|
||||||
ss << "Single shared memory (" << multi_id << "-" << detId
|
ss << "Single shared memory (" << multi_id << "-" << detId
|
||||||
<< ":)version mismatch (expected 0x" << std::hex << SLS_SHMVERSION
|
<< ":)version mismatch (expected 0x" << std::hex << SLS_SHMVERSION
|
||||||
<< " but got 0x" << shm()->shmversion << ")" << std::dec;
|
<< " but got 0x" << shm()->shmversion << ")" << std::dec
|
||||||
|
<< ". Clear Shared memory to continue.";
|
||||||
shm.UnmapSharedMemory();
|
shm.UnmapSharedMemory();
|
||||||
throw SharedMemoryError(ss.str());
|
throw SharedMemoryError(ss.str());
|
||||||
}
|
}
|
||||||
@ -584,33 +583,37 @@ void slsDetector::updateTotalNumberOfChannels() {
|
|||||||
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
||||||
shm()->myDetectorType == MOENCH) {
|
shm()->myDetectorType == MOENCH) {
|
||||||
|
|
||||||
int nchans = 0;
|
int nachans = 0, ndchans = 0;
|
||||||
// calculate analog channels
|
int adatabytes = 0, ddatabytes = 0;
|
||||||
|
// analog channels (normal, analog/digital readout)
|
||||||
|
if (shm()->roFlags == slsDetectorDefs::NORMAL_READOUT ||
|
||||||
|
shm()->roFlags & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
uint32_t mask = shm()->adcEnableMask;
|
uint32_t mask = shm()->adcEnableMask;
|
||||||
if (mask == BIT32_MASK) {
|
if (mask == BIT32_MASK) {
|
||||||
nchans = 32;
|
nachans = 32;
|
||||||
} else {
|
} else {
|
||||||
nchans = 0;
|
|
||||||
for (int ich = 0; ich < 32; ++ich) {
|
for (int ich = 0; ich < 32; ++ich) {
|
||||||
if (mask & (1 << ich))
|
if (mask & (1 << ich))
|
||||||
++nchans;
|
++nachans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
adatabytes = nachans * (shm()->dynamicRange / 8) *
|
||||||
|
shm()->timerValue[ANALOG_SAMPLES];
|
||||||
|
FILE_LOG(logDEBUG1)
|
||||||
|
<< "#Analog Channels:" << nachans << " Databytes: " << adatabytes;
|
||||||
|
}
|
||||||
|
|
||||||
// calculate digital channels
|
// digital channels (ctb only, digital, analog/digital readout)
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD &&
|
if (shm()->myDetectorType == CHIPTESTBOARD &&
|
||||||
(((shm()->roFlags & DIGITAL_ONLY) != 0) ||
|
((shm()->roFlags & DIGITAL_ONLY) || (shm()->roFlags & ANALOG_AND_DIGITAL))) {
|
||||||
((shm()->roFlags & ANALOG_AND_DIGITAL) != 0))) {
|
ndchans = 64;
|
||||||
nchans += 4;
|
ddatabytes = (sizeof(uint64_t) * shm()->timerValue[DIGITAL_SAMPLES]);
|
||||||
|
FILE_LOG(logDEBUG1) << "#Digital Channels:" << ndchans
|
||||||
|
<< " Databytes: " << ddatabytes;
|
||||||
}
|
}
|
||||||
shm()->nChan[X] = nchans;
|
shm()->nChans = nachans + ndchans;
|
||||||
|
shm()->dataBytes = adatabytes + ddatabytes;
|
||||||
// recalculate derived parameters chans and databytes
|
FILE_LOG(logDEBUG1) << "# Total #Channels:" << shm()->nChans
|
||||||
shm()->nChans = nchans;
|
|
||||||
shm()->dataBytes = shm()->nChans * shm()->nChips *
|
|
||||||
(shm()->dynamicRange / 8) *
|
|
||||||
shm()->timerValue[SAMPLES];
|
|
||||||
FILE_LOG(logDEBUG1) << "Number of Channels:" << shm()->nChans
|
|
||||||
<< " Databytes: " << shm()->dataBytes;
|
<< " Databytes: " << shm()->dataBytes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -882,10 +885,16 @@ int slsDetector::updateDetectorNoWait(sls::ClientSocket &client) {
|
|||||||
|
|
||||||
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
if (shm()->myDetectorType == CHIPTESTBOARD ||
|
||||||
shm()->myDetectorType == MOENCH) {
|
shm()->myDetectorType == MOENCH) {
|
||||||
// samples
|
// analog samples
|
||||||
n += client.receiveData(&i64, sizeof(i64));
|
n += client.receiveData(&i64, sizeof(i64));
|
||||||
if (i64 >= 0) {
|
if (i64 >= 0) {
|
||||||
shm()->timerValue[SAMPLES] = i64;
|
shm()->timerValue[ANALOG_SAMPLES] = i64;
|
||||||
|
}
|
||||||
|
|
||||||
|
// digital samples
|
||||||
|
n += client.receiveData(&i64, sizeof(i64));
|
||||||
|
if (i64 >= 0) {
|
||||||
|
shm()->timerValue[DIGITAL_SAMPLES] = i64;
|
||||||
}
|
}
|
||||||
|
|
||||||
// adcmask
|
// adcmask
|
||||||
@ -1518,8 +1527,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
|||||||
shm()->timerValue[index] = retval;
|
shm()->timerValue[index] = retval;
|
||||||
// update #nchans and databytes, as it depends on #samples, adcmask,
|
// update #nchans and databytes, as it depends on #samples, adcmask,
|
||||||
// readoutflags
|
// readoutflags
|
||||||
if (index == SAMPLES && (shm()->myDetectorType == CHIPTESTBOARD ||
|
if (index == ANALOG_SAMPLES || index == DIGITAL_SAMPLES) {
|
||||||
shm()->myDetectorType == MOENCH)) {
|
|
||||||
updateTotalNumberOfChannels();
|
updateTotalNumberOfChannels();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1548,7 +1556,8 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
|
|||||||
ACQUISITION_TIME,
|
ACQUISITION_TIME,
|
||||||
SUBFRAME_ACQUISITION_TIME,
|
SUBFRAME_ACQUISITION_TIME,
|
||||||
SUBFRAME_DEADTIME,
|
SUBFRAME_DEADTIME,
|
||||||
SAMPLES,
|
ANALOG_SAMPLES,
|
||||||
|
DIGITAL_SAMPLES,
|
||||||
STORAGE_CELL_NUMBER};
|
STORAGE_CELL_NUMBER};
|
||||||
|
|
||||||
if (std::any_of(std::begin(rt), std::end(rt),
|
if (std::any_of(std::begin(rt), std::end(rt),
|
||||||
@ -1884,7 +1893,8 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
|||||||
<< "\nsub exp time:"
|
<< "\nsub exp time:"
|
||||||
<< (shm()->timerValue[SUBFRAME_ACQUISITION_TIME])
|
<< (shm()->timerValue[SUBFRAME_ACQUISITION_TIME])
|
||||||
<< "\nsub dead time:" << (shm()->timerValue[SUBFRAME_DEADTIME])
|
<< "\nsub dead time:" << (shm()->timerValue[SUBFRAME_DEADTIME])
|
||||||
<< "\nsamples:" << (shm()->timerValue[SAMPLES])
|
<< "\nasamples:" << (shm()->timerValue[ANALOG_SAMPLES])
|
||||||
|
<< "\ndsamples:" << (shm()->timerValue[DIGITAL_SAMPLES])
|
||||||
<< "\ndynamic range:" << shm()->dynamicRange
|
<< "\ndynamic range:" << shm()->dynamicRange
|
||||||
<< "\nflippeddatax:" << (shm()->flippedData[X])
|
<< "\nflippeddatax:" << (shm()->flippedData[X])
|
||||||
<< "\nactivated: " << shm()->activated
|
<< "\nactivated: " << shm()->activated
|
||||||
@ -1939,14 +1949,16 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CHIPTESTBOARD:
|
case CHIPTESTBOARD:
|
||||||
setTimer(SAMPLES, shm()->timerValue[SAMPLES]);
|
setTimer(ANALOG_SAMPLES, shm()->timerValue[ANALOG_SAMPLES]);
|
||||||
|
setTimer(DIGITAL_SAMPLES, shm()->timerValue[DIGITAL_SAMPLES]);
|
||||||
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
||||||
setReadOutFlags(GET_READOUT_FLAGS);
|
setReadOutFlags(GET_READOUT_FLAGS);
|
||||||
setADCEnableMask(shm()->adcEnableMask);
|
setADCEnableMask(shm()->adcEnableMask);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MOENCH:
|
case MOENCH:
|
||||||
setTimer(SAMPLES, shm()->timerValue[SAMPLES]);
|
setTimer(ANALOG_SAMPLES, shm()->timerValue[ANALOG_SAMPLES]);
|
||||||
|
setTimer(DIGITAL_SAMPLES, shm()->timerValue[DIGITAL_SAMPLES]);
|
||||||
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
enableTenGigabitEthernet(shm()->tenGigaEnable);
|
||||||
setADCEnableMask(shm()->adcEnableMask);
|
setADCEnableMask(shm()->adcEnableMask);
|
||||||
break;
|
break;
|
||||||
|
@ -609,12 +609,26 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page timing
|
/*! \page timing
|
||||||
- <b>samples [i]</b> sets/gets number of samples expected from the jctb. Used in CHIP TEST BOARD only. \c Returns \c (long long int)
|
- <b>samples [i]</b> sets/gets number of samples (both analog and digital) expected from the ctb. Used in CHIP TEST BOARD and MOENCH only. \c Returns \c (long long int)
|
||||||
*/
|
*/
|
||||||
descrToFuncMap[i].m_pFuncName = "samples";
|
descrToFuncMap[i].m_pFuncName = "samples";
|
||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
|
/*! \page timing
|
||||||
|
- <b>asamples [i]</b> sets/gets number of analog samples expected from the ctb. Used in CHIP TEST BOARD and MOENCH only. \c Returns \c (long long int)
|
||||||
|
*/
|
||||||
|
descrToFuncMap[i].m_pFuncName = "asamples";
|
||||||
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
|
||||||
|
++i;
|
||||||
|
|
||||||
|
/*! \page timing
|
||||||
|
- <b>bsamples [i]</b> sets/gets number of digital samples expected from the ctb. Used in CHIP TEST BOARD and MOENCH only. \c Returns \c (long long int)
|
||||||
|
*/
|
||||||
|
descrToFuncMap[i].m_pFuncName = "bsamples";
|
||||||
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
|
||||||
|
++i;
|
||||||
|
|
||||||
/*! \page timing
|
/*! \page timing
|
||||||
- <b>storagecells [i]</b> sets/gets number of additional storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells +1). \c Returns \c (long long int)
|
- <b>storagecells [i]</b> sets/gets number of additional storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells +1). \c Returns \c (long long int)
|
||||||
*/
|
*/
|
||||||
@ -1934,6 +1948,11 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
|
|||||||
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern;
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
|
/** not documenting this, but keeping this for backwards compatibility */
|
||||||
|
descrToFuncMap[i].m_pFuncName = "adcdisable";
|
||||||
|
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdPattern;
|
||||||
|
++i;
|
||||||
|
|
||||||
/*! \page prototype
|
/*! \page prototype
|
||||||
- <b>pattern fn</b> loads binary pattern file fn
|
- <b>pattern fn</b> loads binary pattern file fn
|
||||||
*/
|
*/
|
||||||
@ -4426,8 +4445,13 @@ std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int
|
|||||||
index = CYCLES_NUMBER;
|
index = CYCLES_NUMBER;
|
||||||
else if (cmd == "measurements")
|
else if (cmd == "measurements")
|
||||||
index = MEASUREMENTS_NUMBER;
|
index = MEASUREMENTS_NUMBER;
|
||||||
|
// also does digital sample
|
||||||
else if (cmd == "samples")
|
else if (cmd == "samples")
|
||||||
index = SAMPLES;
|
index = ANALOG_SAMPLES;
|
||||||
|
else if (cmd == "asamples")
|
||||||
|
index = ANALOG_SAMPLES;
|
||||||
|
else if (cmd == "bsamples")
|
||||||
|
index = DIGITAL_SAMPLES;
|
||||||
else if (cmd == "storagecells")
|
else if (cmd == "storagecells")
|
||||||
index = STORAGE_CELL_NUMBER;
|
index = STORAGE_CELL_NUMBER;
|
||||||
else if (cmd == "storagecell_delay")
|
else if (cmd == "storagecell_delay")
|
||||||
@ -4466,6 +4490,14 @@ std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int
|
|||||||
|
|
||||||
ret = myDet->setTimer(index, t, detPos);
|
ret = myDet->setTimer(index, t, detPos);
|
||||||
|
|
||||||
|
// samples command does both asamples and dsamples
|
||||||
|
if (cmd == "samples" ) {
|
||||||
|
int64_t dret = myDet->setTimer(DIGITAL_SAMPLES, t, detPos);
|
||||||
|
if (dret != ret) {
|
||||||
|
throw sls::RuntimeError("Analog and digital number of samples are different. Check with asamples and dsamples command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret != -1) && (index == ACQUISITION_TIME || index == SUBFRAME_ACQUISITION_TIME ||
|
if ((ret != -1) && (index == ACQUISITION_TIME || index == SUBFRAME_ACQUISITION_TIME ||
|
||||||
index == FRAME_PERIOD || index == DELAY_AFTER_TRIGGER ||
|
index == FRAME_PERIOD || index == DELAY_AFTER_TRIGGER ||
|
||||||
index == SUBFRAME_DEADTIME || index == STORAGE_CELL_DELAY)) {
|
index == SUBFRAME_DEADTIME || index == STORAGE_CELL_DELAY)) {
|
||||||
@ -4487,7 +4519,9 @@ std::string slsDetectorCommand::helpTimer(int action) {
|
|||||||
os << "delay t \t sets the delay after trigger in s" << std::endl;
|
os << "delay t \t sets the delay after trigger in s" << std::endl;
|
||||||
os << "frames t \t sets the number of frames per cycle (e.g. after each trigger)" << std::endl;
|
os << "frames t \t sets the number of frames per cycle (e.g. after each trigger)" << std::endl;
|
||||||
os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl;
|
os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl;
|
||||||
os << "samples t \t sets the number of samples expected from the jctb" << std::endl;
|
os << "samples t \t sets the number of samples (both analog and digital) expected from the ctb" << std::endl;
|
||||||
|
os << "asamples t \t sets the number of analog samples expected from the ctb" << std::endl;
|
||||||
|
os << "dsamples t \t sets the number of digital samples expected from the ctb" << std::endl;
|
||||||
os << "storagecells t \t sets number of storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells+1)." << std::endl;
|
os << "storagecells t \t sets number of storage cells per acquisition. For very advanced users only! For JUNGFRAU only. Range: 0-15. The #images = #frames * #cycles * (#storagecells+1)." << std::endl;
|
||||||
os << "storagecell_start t \t sets the storage cell that stores the first acquisition of the series. Default is 15(0xf). For very advanced users only! For JUNGFRAU only. Range: 0-15." << std::endl;
|
os << "storagecell_start t \t sets the storage cell that stores the first acquisition of the series. Default is 15(0xf). For very advanced users only! For JUNGFRAU only. Range: 0-15." << std::endl;
|
||||||
os << "storagecell_delay t \t sets additional time to t between 2 storage cells. For very advanced users only! For JUNGFRAU only. Range: 0-1638375 ns (resolution of 25ns).. " << std::endl;
|
os << "storagecell_delay t \t sets additional time to t between 2 storage cells. For very advanced users only! For JUNGFRAU only. Range: 0-1638375 ns (resolution of 25ns).. " << std::endl;
|
||||||
@ -4502,7 +4536,9 @@ std::string slsDetectorCommand::helpTimer(int action) {
|
|||||||
os << "delay \t gets the delay after trigger in s" << std::endl;
|
os << "delay \t gets the delay after trigger in s" << std::endl;
|
||||||
os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl;
|
os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl;
|
||||||
os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl;
|
os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl;
|
||||||
os << "samples \t gets the number of samples expected from the jctb" << std::endl;
|
os << "samples \t gets the number of samples (both analog and digital) expected from the ctb" << std::endl;
|
||||||
|
os << "asamples \t gets the number of analog samples expected from the ctb" << std::endl;
|
||||||
|
os << "dsamples \t gets the number of digital samples expected from the ctb" << std::endl;
|
||||||
os << "storagecells \t gets number of storage cells per acquisition.For JUNGFRAU only." << std::endl;
|
os << "storagecells \t gets number of storage cells per acquisition.For JUNGFRAU only." << std::endl;
|
||||||
os << "storagecell_start \t gets the storage cell that stores the first acquisition of the series." << std::endl;
|
os << "storagecell_start \t gets the storage cell that stores the first acquisition of the series." << std::endl;
|
||||||
os << "storagecell_delay \tgets additional time between 2 storage cells. " << std::endl;
|
os << "storagecell_delay \tgets additional time between 2 storage cells. " << std::endl;
|
||||||
@ -5592,6 +5628,26 @@ std::string slsDetectorCommand::cmdPattern(int narg, char *args[], int action, i
|
|||||||
|
|
||||||
os << std::hex << myDet->getADCEnableMask(detPos) << std::dec;
|
os << std::hex << myDet->getADCEnableMask(detPos) << std::dec;
|
||||||
}
|
}
|
||||||
|
// kept only for backwards compatibility, use adcenable
|
||||||
|
else if (cmd == "adcdisable") {
|
||||||
|
|
||||||
|
if (action == PUT_ACTION) {
|
||||||
|
uint32_t adcEnableMask = 0;
|
||||||
|
if (sscanf(args[1], "%x", &adcEnableMask))
|
||||||
|
;
|
||||||
|
else
|
||||||
|
return std::string("Could not scan adcdisable reg ") + std::string(args[1]);
|
||||||
|
|
||||||
|
// get enable mask from enable mask
|
||||||
|
adcEnableMask ^= BIT32_MASK;
|
||||||
|
myDet->setADCEnableMask(adcEnableMask, detPos);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t retval = myDet->getADCEnableMask(detPos);
|
||||||
|
// get disable mask
|
||||||
|
retval ^= BIT32_MASK;
|
||||||
|
os << std::hex << retval << std::dec;
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
return helpPattern(action);
|
return helpPattern(action);
|
||||||
|
@ -179,14 +179,6 @@ public:
|
|||||||
FILE_LOG(logERROR) << "SetTenGigaEnable is a generic function that should be overloaded by a derived class";
|
FILE_LOG(logERROR) << "SetTenGigaEnable is a generic function that should be overloaded by a derived class";
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Setting packets per frame changes member variables
|
|
||||||
* @param ns number of samples
|
|
||||||
*/
|
|
||||||
virtual void setNumberofSamples(const uint64_t ns) {
|
|
||||||
FILE_LOG(logERROR) << "setNumberofSamples is a generic function that should be overloaded by a derived class";
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable Gap Pixels changes member variables
|
* Enable Gap Pixels changes member variables
|
||||||
* @param enable true if gap pixels enable, else false
|
* @param enable true if gap pixels enable, else false
|
||||||
@ -209,11 +201,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set databytes (ctb, moench)
|
* Set databytes (ctb, moench)
|
||||||
* @param a adc enable mask
|
* @param a adc enable mask
|
||||||
* @param s number of samples
|
* @param as analog number of samples
|
||||||
|
* @param ds digital number of samples
|
||||||
* @param t tengiga enable
|
* @param t tengiga enable
|
||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
*/
|
*/
|
||||||
virtual void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
virtual void setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||||
cprintf(RED,"setImageSize is a generic function that should be overloaded by a derived class\n");
|
cprintf(RED,"setImageSize is a generic function that should be overloaded by a derived class\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -557,7 +550,9 @@ private:
|
|||||||
/** Number of analog channels */
|
/** Number of analog channels */
|
||||||
const int NCHAN_ANALOG = 32;
|
const int NCHAN_ANALOG = 32;
|
||||||
/** Number of digital channels */
|
/** Number of digital channels */
|
||||||
const int NCHAN_DIGITAL = 4;
|
const int NCHAN_DIGITAL = 64;
|
||||||
|
/** Number of bytes per analog channel */
|
||||||
|
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
@ -581,46 +576,60 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Set databytes (ctb, moench)
|
* Set databytes (ctb, moench)
|
||||||
* @param a adc enable mask
|
* @param a adc enable mask
|
||||||
* @param s number of samples
|
* @param as analog number of samples
|
||||||
|
* @param ds digital number of samples
|
||||||
* @param t tengiga enable
|
* @param t tengiga enable
|
||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
*/
|
*/
|
||||||
void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
void setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||||
int nchans = 0;
|
int nachans = 0, ndchans = 0;
|
||||||
|
int adatabytes = 0, ddatabytes = 0;
|
||||||
|
|
||||||
if (f != slsDetectorDefs::GET_READOUT_FLAGS) {
|
if (f != slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||||
// analog channels
|
// analog channels (normal, analog/digital readout)
|
||||||
if (f == slsDetectorDefs::NORMAL_READOUT || f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
if (f == slsDetectorDefs::NORMAL_READOUT ||
|
||||||
|
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
if (a == BIT32_MASK) {
|
if (a == BIT32_MASK) {
|
||||||
nchans = 32;
|
nachans = 32;
|
||||||
} else {
|
} else {
|
||||||
for (int ich = 0; ich < 32; ++ich) {
|
for (int ich = 0; ich < 32; ++ich) {
|
||||||
if (a & (1 << ich))
|
if (a & (1 << ich))
|
||||||
++nchans;
|
++nachans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
||||||
|
FILE_LOG(logDEBUG1) << " Number of Analog Channels:" << nachans
|
||||||
|
<< " Databytes: " << adatabytes;
|
||||||
}
|
}
|
||||||
// digital channels
|
// digital channels
|
||||||
if (f & slsDetectorDefs::DIGITAL_ONLY || f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
if (f & slsDetectorDefs::DIGITAL_ONLY ||
|
||||||
nchans += NCHAN_DIGITAL;
|
f & slsDetectorDefs::ANALOG_AND_DIGITAL) {
|
||||||
|
ndchans = NCHAN_DIGITAL;
|
||||||
|
ddatabytes = (sizeof(uint64_t) * ds);
|
||||||
|
FILE_LOG(logDEBUG1) << "Number of Digital Channels:" << ndchans
|
||||||
|
<< " Databytes: " << ddatabytes;
|
||||||
}
|
}
|
||||||
|
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans + ndchans
|
||||||
|
<< " Databytes: " << adatabytes + ddatabytes;
|
||||||
}
|
}
|
||||||
nPixelsX = nchans;
|
nPixelsX = nachans + ndchans;
|
||||||
nPixelsY = s;
|
nPixelsY = 1;
|
||||||
// 10G
|
// 10G
|
||||||
if (t) {
|
if (t) {
|
||||||
headerSizeinPacket = 22;
|
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||||
dataSize = 8192;
|
dataSize = UDP_PACKET_DATA_BYTES;
|
||||||
packetSize = headerSizeinPacket + dataSize;
|
packetSize = headerSizeinPacket + dataSize;
|
||||||
imageSize = nPixelsX * nPixelsY * 2;
|
imageSize = adatabytes + ddatabytes;
|
||||||
packetsPerFrame = ceil((double)imageSize / (double)packetSize);
|
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||||
standardheader = false; }
|
standardheader = true;
|
||||||
|
}
|
||||||
// 1g udp (via fifo readout)
|
// 1g udp (via fifo readout)
|
||||||
else {
|
else {
|
||||||
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||||
dataSize = UDP_PACKET_DATA_BYTES;
|
dataSize = UDP_PACKET_DATA_BYTES;
|
||||||
packetSize = headerSizeinPacket + dataSize;
|
packetSize = headerSizeinPacket + dataSize;
|
||||||
imageSize = nPixelsX * nPixelsY * 2;
|
imageSize = adatabytes + ddatabytes;
|
||||||
packetsPerFrame = ceil((double)imageSize / (double)UDP_PACKET_DATA_BYTES);
|
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||||
standardheader = true;
|
standardheader = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,13 +641,8 @@ class MoenchData : public GeneralData {
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Structure of an jungfrau ctb packet header (10G Udp) */
|
/** Number of bytes per analog channel */
|
||||||
struct jfrauctb_packet_header {
|
const int NUM_BYTES_PER_ANALOG_CHANNEL = 2;
|
||||||
unsigned char emptyHeader[6];
|
|
||||||
unsigned char reserved[4];
|
|
||||||
uint32_t packetFrameNumber;
|
|
||||||
uint64_t bunchid;
|
|
||||||
} __attribute__((packed));
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
@ -654,73 +658,56 @@ public:
|
|||||||
packetsPerFrame = ceil((double)imageSize / (double)UDP_PACKET_DATA_BYTES);
|
packetsPerFrame = ceil((double)imageSize / (double)UDP_PACKET_DATA_BYTES);
|
||||||
frameIndexMask = 0xFFFFFF;
|
frameIndexMask = 0xFFFFFF;
|
||||||
maxFramesPerFile = CTB_MAX_FRAMES_PER_FILE;
|
maxFramesPerFile = CTB_MAX_FRAMES_PER_FILE;
|
||||||
fifoBufferHeaderSize =
|
fifoBufferHeaderSize = FIFO_HEADER_NUMBYTES + sizeof(slsDetectorDefs::sls_receiver_header);
|
||||||
FIFO_HEADER_NUMBYTES + sizeof(slsDetectorDefs::sls_receiver_header);
|
|
||||||
defaultFifoDepth = 2500;
|
defaultFifoDepth = 2500;
|
||||||
standardheader = true;
|
standardheader = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Header Infomation (frame number, packet number)
|
|
||||||
* @param index thread index for debugging purposes
|
|
||||||
* @param packetData pointer to data
|
|
||||||
* @param dynamicRange dynamic range to assign subframenumber if 32 bit mode
|
|
||||||
* @param oddStartingPacket odd starting packet (gotthard)
|
|
||||||
* @param frameNumber frame number * @param packetNumber packet number
|
|
||||||
* @param subFrameNumber sub frame number if applicable
|
|
||||||
* @param bunchId bunch id
|
|
||||||
*/
|
|
||||||
void GetHeaderInfo(int index, char* packetData, uint32_t dynamicRange, bool oddStartingPacket,
|
|
||||||
uint64_t& frameNumber, uint32_t& packetNumber, uint32_t& subFrameNumber, uint64_t& bunchId) const {
|
|
||||||
subFrameNumber = -1;
|
|
||||||
auto header = reinterpret_cast<jfrauctb_packet_header*>(packetData);
|
|
||||||
frameNumber = (header->packetFrameNumber >> 8) & frameIndexMask;
|
|
||||||
packetNumber = header->packetFrameNumber & 0xFF;
|
|
||||||
bunchId = header->bunchid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set databytes (ctb, moench)
|
* Set databytes (ctb, moench)
|
||||||
* @param a adc enable mask
|
* @param a adc enable mask
|
||||||
* @param s number of samples
|
* @param as analog number of samples
|
||||||
|
* @param ds digital number of samples
|
||||||
* @param t tengiga enable
|
* @param t tengiga enable
|
||||||
* @param f readout flags
|
* @param f readout flags
|
||||||
*/
|
*/
|
||||||
void setImageSize(uint32_t a, int s, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
void setImageSize(uint32_t a, uint64_t as, uint64_t ds, bool t, slsDetectorDefs::readOutFlags f = slsDetectorDefs::GET_READOUT_FLAGS) {
|
||||||
int nchans = 32;
|
int nachans = 0;
|
||||||
|
int adatabytes = 0;
|
||||||
|
|
||||||
|
// analog channels (normal, analog/digital readout)
|
||||||
if (a == BIT32_MASK) {
|
if (a == BIT32_MASK) {
|
||||||
nchans = 32;
|
nachans = 32;
|
||||||
} else {
|
} else {
|
||||||
for (int ich = 0; ich < 32; ++ich) {
|
for (int ich = 0; ich < 32; ++ich) {
|
||||||
if (a & (1 << ich))
|
if (a & (1 << ich))
|
||||||
++nchans;
|
++nachans;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
adatabytes = nachans * NUM_BYTES_PER_ANALOG_CHANNEL * as;
|
||||||
|
FILE_LOG(logDEBUG1) << "Total Number of Channels:" << nachans
|
||||||
|
<< " Databytes: " << adatabytes;
|
||||||
|
|
||||||
nPixelsX = nchans;
|
nPixelsX = nachans;
|
||||||
nPixelsY = s;
|
nPixelsY = 1;
|
||||||
// 10G
|
// 10G
|
||||||
if (t) {
|
if (t) {
|
||||||
headerSizeinPacket = 22;
|
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||||
dataSize = 8192;
|
dataSize = UDP_PACKET_DATA_BYTES;
|
||||||
packetSize = headerSizeinPacket + dataSize;
|
packetSize = headerSizeinPacket + dataSize;
|
||||||
imageSize = nPixelsX * nPixelsY * 2;
|
imageSize = adatabytes;
|
||||||
packetsPerFrame = (imageSize + packetSize - 1) / packetSize;
|
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||||
standardheader = false;
|
|
||||||
}
|
}
|
||||||
// 1g udp (via fifo readout)
|
// 1g udp (via fifo readout)
|
||||||
else {
|
else {
|
||||||
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
headerSizeinPacket = sizeof(slsDetectorDefs::sls_detector_header);
|
||||||
dataSize = UDP_PACKET_DATA_BYTES;
|
dataSize = UDP_PACKET_DATA_BYTES;
|
||||||
packetSize = headerSizeinPacket + dataSize;
|
packetSize = headerSizeinPacket + dataSize;
|
||||||
imageSize = nPixelsX * nPixelsY * 2;
|
imageSize = adatabytes;
|
||||||
packetsPerFrame = (imageSize + UDP_PACKET_DATA_BYTES - 1) / UDP_PACKET_DATA_BYTES;
|
packetsPerFrame = ceil((double)imageSize / (double)dataSize);
|
||||||
standardheader = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;
|
|
@ -257,10 +257,16 @@ class slsReceiverImplementation: private virtual slsDetectorDefs {
|
|||||||
uint64_t getNumberOfFrames() const;
|
uint64_t getNumberOfFrames() const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get Number of Samples expected by receiver from detector (for chip test board only)
|
* Get Number of Analog Samples expected by receiver from detector (for chip test board and moench only)
|
||||||
* @return number of samples expected
|
* @return number of Analog samples expected
|
||||||
*/
|
*/
|
||||||
uint64_t getNumberofSamples() const;
|
uint64_t getNumberofAnalogSamples() const;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get Number of Digital Samples expected by receiver from detector (for chip test board and moench only)
|
||||||
|
* @return number of Digital samples expected
|
||||||
|
*/
|
||||||
|
uint64_t getNumberofDigitalSamples() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Dynamic Range or Number of Bits Per Pixel
|
* Get Dynamic Range or Number of Bits Per Pixel
|
||||||
@ -571,11 +577,18 @@ class slsReceiverImplementation: private virtual slsDetectorDefs {
|
|||||||
int setNumberOfFrames(const uint64_t i);
|
int setNumberOfFrames(const uint64_t i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Number of Samples expected by receiver from detector
|
* Set Number of Analog Samples expected by receiver from detector
|
||||||
* @param i number of Samples expected
|
* @param i number of Analog Samples expected
|
||||||
* @return OK or FAIL
|
* @return OK or FAIL
|
||||||
*/
|
*/
|
||||||
int setNumberofSamples(const uint64_t i);
|
int setNumberofAnalogSamples(const uint64_t i);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Number of Digital Samples expected by receiver from detector
|
||||||
|
* @param i number of Digital Samples expected
|
||||||
|
* @return OK or FAIL
|
||||||
|
*/
|
||||||
|
int setNumberofDigitalSamples(const uint64_t i);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Dynamic Range or Number of Bits Per Pixel
|
* Set Dynamic Range or Number of Bits Per Pixel
|
||||||
@ -816,8 +829,10 @@ private:
|
|||||||
uint64_t subPeriod;
|
uint64_t subPeriod;
|
||||||
/** Frame Number */
|
/** Frame Number */
|
||||||
uint64_t numberOfFrames;
|
uint64_t numberOfFrames;
|
||||||
/** Samples Number */
|
/** Analog Samples Number */
|
||||||
uint64_t numberOfSamples;
|
uint64_t numberOfAnalogSamples;
|
||||||
|
/** Digital Samples Number */
|
||||||
|
uint64_t numberOfDigitalSamples;
|
||||||
/** Dynamic Range */
|
/** Dynamic Range */
|
||||||
uint32_t dynamicRange;
|
uint32_t dynamicRange;
|
||||||
/** Ten Giga Enable*/
|
/** Ten Giga Enable*/
|
||||||
|
@ -62,7 +62,8 @@ void slsReceiverImplementation::InitializeMembers() {
|
|||||||
subExpTime = 0;
|
subExpTime = 0;
|
||||||
subPeriod = 0;
|
subPeriod = 0;
|
||||||
numberOfFrames = 0;
|
numberOfFrames = 0;
|
||||||
numberOfSamples = 0;
|
numberOfAnalogSamples = 0;
|
||||||
|
numberOfDigitalSamples = 0;
|
||||||
dynamicRange = 16;
|
dynamicRange = 16;
|
||||||
tengigaEnable = false;
|
tengigaEnable = false;
|
||||||
fifoDepth = 0;
|
fifoDepth = 0;
|
||||||
@ -341,9 +342,14 @@ uint64_t slsReceiverImplementation::getNumberOfFrames() const{
|
|||||||
return numberOfFrames;
|
return numberOfFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t slsReceiverImplementation::getNumberofSamples() const{
|
uint64_t slsReceiverImplementation::getNumberofAnalogSamples() const{
|
||||||
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||||
return numberOfSamples;
|
return numberOfAnalogSamples;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t slsReceiverImplementation::getNumberofDigitalSamples() const{
|
||||||
|
FILE_LOG(logDEBUG3) << __SHORT_AT__ << " called";
|
||||||
|
return numberOfDigitalSamples;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t slsReceiverImplementation::getDynamicRange() const{
|
uint32_t slsReceiverImplementation::getDynamicRange() const{
|
||||||
@ -475,7 +481,7 @@ int slsReceiverImplementation::setReadOutFlags(const readOutFlags f) {
|
|||||||
|
|
||||||
// side effects
|
// side effects
|
||||||
if (myDetectorType == CHIPTESTBOARD) {
|
if (myDetectorType == CHIPTESTBOARD) {
|
||||||
generalData->setImageSize(adcEnableMask, numberOfSamples, tengigaEnable, readoutFlags);
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable, readoutFlags);
|
||||||
for (const auto& it : dataProcessor)
|
for (const auto& it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
if (SetupFifoStructure() == FAIL)
|
if (SetupFifoStructure() == FAIL)
|
||||||
@ -823,10 +829,10 @@ int slsReceiverImplementation::setADCEnableMask(uint32_t mask) {
|
|||||||
|
|
||||||
switch (myDetectorType) {
|
switch (myDetectorType) {
|
||||||
case MOENCH:
|
case MOENCH:
|
||||||
generalData->setImageSize(mask, numberOfSamples, tengigaEnable);
|
generalData->setImageSize(mask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable);
|
||||||
break;
|
break;
|
||||||
case CHIPTESTBOARD:
|
case CHIPTESTBOARD:
|
||||||
generalData->setImageSize(mask, numberOfSamples, tengigaEnable, readoutFlags);
|
generalData->setImageSize(mask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable, readoutFlags);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -953,21 +959,41 @@ int slsReceiverImplementation::setNumberOfFrames(const uint64_t i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int slsReceiverImplementation::setNumberofSamples(const uint64_t i) {
|
int slsReceiverImplementation::setNumberofAnalogSamples(const uint64_t i) {
|
||||||
if (numberOfSamples != i) {
|
if (numberOfAnalogSamples != i) {
|
||||||
numberOfSamples = i;
|
numberOfAnalogSamples = i;
|
||||||
|
|
||||||
if(myDetectorType == MOENCH) {
|
if(myDetectorType == MOENCH) {
|
||||||
generalData->setImageSize(adcEnableMask, numberOfSamples, tengigaEnable);
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable);
|
||||||
} else if(myDetectorType == CHIPTESTBOARD) {
|
} else if(myDetectorType == CHIPTESTBOARD) {
|
||||||
generalData->setImageSize(adcEnableMask, numberOfSamples, tengigaEnable, readoutFlags);
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable, readoutFlags);
|
||||||
}
|
}
|
||||||
for (const auto& it : dataProcessor)
|
for (const auto& it : dataProcessor)
|
||||||
it->SetPixelDimension();
|
it->SetPixelDimension();
|
||||||
if (SetupFifoStructure() == FAIL)
|
if (SetupFifoStructure() == FAIL)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
FILE_LOG (logINFO) << "Number of Samples: " << numberOfSamples;
|
FILE_LOG (logINFO) << "Number of Analog Samples: " << numberOfAnalogSamples;
|
||||||
|
FILE_LOG (logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int slsReceiverImplementation::setNumberofDigitalSamples(const uint64_t i) {
|
||||||
|
if (numberOfDigitalSamples != i) {
|
||||||
|
numberOfDigitalSamples = i;
|
||||||
|
|
||||||
|
if(myDetectorType == MOENCH) {
|
||||||
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable);
|
||||||
|
} else if(myDetectorType == CHIPTESTBOARD) {
|
||||||
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable, readoutFlags);
|
||||||
|
}
|
||||||
|
for (const auto& it : dataProcessor)
|
||||||
|
it->SetPixelDimension();
|
||||||
|
if (SetupFifoStructure() == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
|
FILE_LOG (logINFO) << "Number of Digital Samples: " << numberOfDigitalSamples;
|
||||||
FILE_LOG (logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
FILE_LOG (logINFO) << "Packets per Frame: " << (generalData->packetsPerFrame);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -999,10 +1025,10 @@ int slsReceiverImplementation::setTenGigaEnable(const bool b) {
|
|||||||
generalData->SetTenGigaEnable(b,dynamicRange);
|
generalData->SetTenGigaEnable(b,dynamicRange);
|
||||||
break;
|
break;
|
||||||
case MOENCH:
|
case MOENCH:
|
||||||
generalData->setImageSize(adcEnableMask, numberOfSamples, tengigaEnable);
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable);
|
||||||
break;
|
break;
|
||||||
case CHIPTESTBOARD:
|
case CHIPTESTBOARD:
|
||||||
generalData->setImageSize(adcEnableMask, numberOfSamples, tengigaEnable, readoutFlags);
|
generalData->setImageSize(adcEnableMask, numberOfAnalogSamples, numberOfDigitalSamples, tengigaEnable, readoutFlags);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -877,12 +877,19 @@ int slsReceiverTCPIPInterface::set_timer() {
|
|||||||
case SUBFRAME_DEADTIME:
|
case SUBFRAME_DEADTIME:
|
||||||
receiver->setSubPeriod(index[1] + receiver->getSubExpTime());
|
receiver->setSubPeriod(index[1] + receiver->getSubExpTime());
|
||||||
break;
|
break;
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
||||||
modeNotImplemented("(Samples) Timer index", (int)index[0]);
|
modeNotImplemented("(Analog Samples) Timer index", (int)index[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
receiver->setNumberofSamples(index[1]);
|
receiver->setNumberofAnalogSamples(index[1]);
|
||||||
|
break;
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
|
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
||||||
|
modeNotImplemented("(Digital Samples) Timer index", (int)index[0]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
receiver->setNumberofDigitalSamples(index[1]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
modeNotImplemented("Timer index", (int)index[0]);
|
modeNotImplemented("Timer index", (int)index[0]);
|
||||||
@ -909,14 +916,23 @@ int slsReceiverTCPIPInterface::set_timer() {
|
|||||||
case SUBFRAME_DEADTIME:
|
case SUBFRAME_DEADTIME:
|
||||||
retval=(receiver->getSubPeriod() - receiver->getSubExpTime());
|
retval=(receiver->getSubPeriod() - receiver->getSubExpTime());
|
||||||
break;
|
break;
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess,"This timer mode (%lld) does not exist for this receiver type\n", (long long int)index[0]);
|
sprintf(mess,"This timer mode (%lld) does not exist for this receiver type\n", (long long int)index[0]);
|
||||||
FILE_LOG(logERROR) << "Warning: " << mess;
|
FILE_LOG(logERROR) << "Warning: " << mess;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
retval=receiver->getNumberofSamples();
|
retval=receiver->getNumberofAnalogSamples();
|
||||||
|
break;
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
|
if (myDetectorType != CHIPTESTBOARD && myDetectorType != MOENCH) {
|
||||||
|
ret = FAIL;
|
||||||
|
sprintf(mess,"This timer mode (%lld) does not exist for this receiver type\n", (long long int)index[0]);
|
||||||
|
FILE_LOG(logERROR) << "Warning: " << mess;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
retval=receiver->getNumberofDigitalSamples();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
modeNotImplemented("Timer index", (int)index[0]);
|
modeNotImplemented("Timer index", (int)index[0]);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# test-GeneralData.cpp
|
# test-GeneralData.cpp
|
||||||
# )
|
# )
|
||||||
|
|
||||||
target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-GeneralData.cpp)
|
#target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-GeneralData.cpp)
|
||||||
|
|
||||||
# add_executable(testSlsReceiver ${SOURCES})
|
# add_executable(testSlsReceiver ${SOURCES})
|
||||||
# target_link_libraries(testSlsReceiver
|
# target_link_libraries(testSlsReceiver
|
||||||
|
@ -117,7 +117,8 @@ class slsDetectorDefs {
|
|||||||
MEASUREMENTS_NUMBER,
|
MEASUREMENTS_NUMBER,
|
||||||
FRAMES_FROM_START,
|
FRAMES_FROM_START,
|
||||||
FRAMES_FROM_START_PG,
|
FRAMES_FROM_START_PG,
|
||||||
SAMPLES,
|
ANALOG_SAMPLES,
|
||||||
|
DIGITAL_SAMPLES,
|
||||||
SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||||
STORAGE_CELL_NUMBER, /**<number of storage cells */
|
STORAGE_CELL_NUMBER, /**<number of storage cells */
|
||||||
SUBFRAME_DEADTIME, /**< subframe deadtime */
|
SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||||
@ -930,12 +931,12 @@ format
|
|||||||
\param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD,
|
\param s can be FRAME_NUMBER,ACQUISITION_TIME,FRAME_PERIOD,
|
||||||
DELAY_AFTER_TRIGGER,GATES_NUMBER, CYCLES_NUMBER,
|
DELAY_AFTER_TRIGGER,GATES_NUMBER, CYCLES_NUMBER,
|
||||||
ACTUAL_TIME,MEASUREMENT_TIME,
|
ACTUAL_TIME,MEASUREMENT_TIME,
|
||||||
PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,SAMPLES,SUBFRAME_ACQUISITION_TIME,STORAGE_CELL_NUMBER,
|
PROGRESS,MEASUREMENTS_NUMBER,FRAMES_FROM_START,FRAMES_FROM_START_PG,ANALOG_SAMPLES,DIGITAL_SAMPLES,SUBFRAME_ACQUISITION_TIME,STORAGE_CELL_NUMBER,
|
||||||
SUBFRAME_DEADTIME \returns std::string
|
SUBFRAME_DEADTIME \returns std::string
|
||||||
frame_number,acquisition_time,frame_period,
|
frame_number,acquisition_time,frame_period,
|
||||||
delay_after_trigger,gates_number, cycles_number,
|
delay_after_trigger,gates_number, cycles_number,
|
||||||
actual_time,measurement_time,
|
actual_time,measurement_time,
|
||||||
progress,measurements_number,frames_from_start,frames_from_start_pg,samples,subframe_acquisition_time,storage_cell_number,
|
progress,measurements_number,frames_from_start,frames_from_start_pg,analog_samples, digital_samples,subframe_acquisition_time,storage_cell_number,
|
||||||
SUBFRAME_DEADTIME
|
SUBFRAME_DEADTIME
|
||||||
*/
|
*/
|
||||||
static std::string getTimerType(timerIndex t) {
|
static std::string getTimerType(timerIndex t) {
|
||||||
@ -964,8 +965,10 @@ format
|
|||||||
return std::string("frames_from_start");
|
return std::string("frames_from_start");
|
||||||
case FRAMES_FROM_START_PG:
|
case FRAMES_FROM_START_PG:
|
||||||
return std::string("frames_from_start_pg");
|
return std::string("frames_from_start_pg");
|
||||||
case SAMPLES:
|
case ANALOG_SAMPLES:
|
||||||
return std::string("samples");
|
return std::string("analog_samples");
|
||||||
|
case DIGITAL_SAMPLES:
|
||||||
|
return std::string("digital_samples");
|
||||||
case SUBFRAME_ACQUISITION_TIME:
|
case SUBFRAME_ACQUISITION_TIME:
|
||||||
return std::string("subframe_acquisition_time");
|
return std::string("subframe_acquisition_time");
|
||||||
case SUBFRAME_DEADTIME:
|
case SUBFRAME_DEADTIME:
|
||||||
|
@ -7,4 +7,4 @@
|
|||||||
#define APIRECEIVER 0x190405
|
#define APIRECEIVER 0x190405
|
||||||
#define APIGUI 0x190405
|
#define APIGUI 0x190405
|
||||||
#define APIEIGER 0x190418
|
#define APIEIGER 0x190418
|
||||||
#define APICTB 0x190426
|
#define APICTB 0x190430
|
||||||
|
Loading…
x
Reference in New Issue
Block a user