partialread changed to readnrows

This commit is contained in:
2021-08-31 16:46:49 +02:00
parent 11b1d9f6db
commit 25d03f949e
35 changed files with 171 additions and 168 deletions

View File

@ -187,7 +187,7 @@ int ClientInterface::functionTable(){
flist[F_SET_RECEIVER_DBIT_OFFSET] = &ClientInterface::set_dbit_offset;
flist[F_GET_RECEIVER_DBIT_OFFSET] = &ClientInterface::get_dbit_offset;
flist[F_SET_RECEIVER_QUAD] = &ClientInterface::set_quad_type;
flist[F_SET_RECEIVER_PARTIAL_READOUT] = &ClientInterface::set_partial_readout;
flist[F_SET_RECEIVER_READ_N_ROWS] = &ClientInterface::set_read_n_rows;
flist[F_SET_RECEIVER_UDP_IP] = &ClientInterface::set_udp_ip;
flist[F_SET_RECEIVER_UDP_IP2] = &ClientInterface::set_udp_ip2;
flist[F_SET_RECEIVER_UDP_PORT] = &ClientInterface::set_udp_port;
@ -417,7 +417,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]);
}
if (myDetectorType == EIGER || myDetectorType == JUNGFRAU) {
impl()->setPartialReadout(arg.partialReadout);
impl()->setReadNRows(arg.readNRows);
}
if (myDetectorType == MYTHEN3) {
std::array<int, 3> val;
@ -1406,19 +1406,19 @@ int ClientInterface::set_quad_type(Interface &socket) {
return socket.Send(OK);
}
int ClientInterface::set_partial_readout(Interface &socket) {
int ClientInterface::set_read_n_rows(Interface &socket) {
auto arg = socket.Receive<int>();
if (arg >= 0) {
verifyIdle(socket);
if (myDetectorType != EIGER && myDetectorType != JUNGFRAU) {
throw RuntimeError("Could not set partial readout. Not implemented for this detector");
throw RuntimeError("Could not set number of rows. Not implemented for this detector");
}
LOG(logDEBUG1) << "Setting Partial Readout:" << arg;
impl()->setPartialReadout(arg);
LOG(logDEBUG1) << "Setting number of rows:" << arg;
impl()->setReadNRows(arg);
}
int retval = impl()->getPartialReadout();
validate(arg, retval, "set partial readout", DEC);
LOG(logDEBUG1) << "read partial readout:" << retval;
int retval = impl()->getReadNRows();
validate(arg, retval, "set number of rows", DEC);
LOG(logDEBUG1) << "read number of rows:" << retval;
return socket.Send(OK);
}

View File

@ -138,7 +138,7 @@ class ClientInterface : private virtual slsDetectorDefs {
int set_dbit_offset(sls::ServerInterface &socket);
int get_dbit_offset(sls::ServerInterface &socket);
int set_quad_type(sls::ServerInterface &socket);
int set_partial_readout(sls::ServerInterface &socket);
int set_read_n_rows(sls::ServerInterface &socket);
sls::MacAddr setUdpIp(sls::IpAddr arg);
int set_udp_ip(sls::ServerInterface &socket);
sls::MacAddr setUdpIp2(sls::IpAddr arg);

View File

@ -476,9 +476,9 @@ std::vector<uint64_t> Implementation::getNumMissingPackets() const {
for (int i = 0; i < numThreads; i++) {
int np = generalData->packetsPerFrame;
uint64_t totnp = np;
// partial readout
if (partialReadout != (int)generalData->maxRowsPerReadout) {
totnp = ((partialReadout * np) / generalData->maxRowsPerReadout);
// ReadNRows
if (readNRows != (int)generalData->maxRowsPerReadout) {
totnp = ((readNRows * np) / generalData->maxRowsPerReadout);
}
totnp *= numberOfTotalFrames;
mp[i] = listener[i]->GetNumMissingPacket(stoppedFlag, totnp);
@ -765,7 +765,7 @@ void Implementation::SetupWriter() {
masterAttributes->subExptime = subExpTime;
masterAttributes->subPeriod = subPeriod;
masterAttributes->quad = quadEnable;
masterAttributes->partialReadout = partialReadout;
masterAttributes->readNRows = readNRows;
masterAttributes->ratecorr = rateCorrections;
masterAttributes->adcmask =
tengigaEnable ? adcEnableMaskTenGiga : adcEnableMaskOneGiga;
@ -1533,11 +1533,11 @@ void Implementation::setDeactivatedPadding(bool enable) {
<< (deactivatedPaddingEnable ? "enabled" : "disabled");
}
int Implementation::getPartialReadout() const { return partialReadout; }
int Implementation::getReadNRows() const { return readNRows; }
void Implementation::setPartialReadout(const int value) {
partialReadout = value;
LOG(logINFO) << "Partial readout (#rows): " << partialReadout;
void Implementation::setReadNRows(const int value) {
readNRows = value;
LOG(logINFO) << "Number of rows: " << readNRows;
}
void Implementation::setThresholdEnergy(const int value) {

View File

@ -218,9 +218,9 @@ class Implementation : private virtual slsDetectorDefs {
bool getDeactivatedPadding() const;
/* [Eiger] */
void setDeactivatedPadding(const bool enable);
int getPartialReadout() const;
int getReadNRows() const;
/* [Eiger][Jungfrau] */
void setPartialReadout(const int value);
void setReadNRows(const int value);
/** [Eiger] */
void setThresholdEnergy(const int value);
void setThresholdEnergy(const std::array<int, 3> value);
@ -352,7 +352,7 @@ class Implementation : private virtual slsDetectorDefs {
bool activated{true};
std::array<bool, 2> detectorDataStream = {{true, true}};
bool deactivatedPaddingEnable{true};
int partialReadout{0};
int readNRows{0};
int thresholdEnergyeV{-1};
std::array<int, 3> thresholdAllEnergyeV = {{-1, -1, -1}};
std::vector<int64_t> rateCorrections;

View File

@ -37,7 +37,7 @@ struct MasterAttributes {
ns subExptime{0};
ns subPeriod{0};
uint32_t quad{0};
uint32_t partialReadout;
uint32_t readNRows;
std::vector<int64_t> ratecorr;
uint32_t adcmask{0};
uint32_t analog{0};
@ -337,7 +337,7 @@ class JungfrauMasterAttributes : public MasterAttributes {
<< "Exptime : " << sls::ToString(exptime) << '\n'
<< "Period : " << sls::ToString(period) << '\n'
<< "Number of UDP Interfaces : " << numUDPInterfaces << '\n'
<< "Partial Readout (rows) : " << partialReadout << '\n';
<< "Number of rows : " << readNRows << '\n';
std::string message = oss.str();
MasterAttributes::WriteBinaryAttributes(fd, message);
};
@ -353,12 +353,12 @@ class JungfrauMasterAttributes : public MasterAttributes {
"Number of UDP Interfaces", PredType::NATIVE_INT, dataspace);
dataset.write(&numUDPInterfaces, PredType::NATIVE_INT);
}
// partialReadout
// readNRows
{
DataSpace dataspace = DataSpace(H5S_SCALAR);
DataSet dataset = group->createDataSet(
"Partial readout (rows)", PredType::NATIVE_INT, dataspace);
dataset.write(&partialReadout, PredType::NATIVE_INT);
"Number of rows", PredType::NATIVE_INT, dataspace);
dataset.write(&readNRows, PredType::NATIVE_INT);
}
};
#endif
@ -381,7 +381,7 @@ class EigerMasterAttributes : public MasterAttributes {
<< "SubPeriod : " << sls::ToString(subPeriod)
<< '\n'
<< "Quad : " << quad << '\n'
<< "Partial Readout (rows) : " << partialReadout << '\n'
<< "Number of rows : " << readNRows << '\n'
<< "Rate Corrections : " << sls::ToString(ratecorr)
<< '\n';
std::string message = oss.str();
@ -435,12 +435,12 @@ class EigerMasterAttributes : public MasterAttributes {
group->createDataSet("Quad", PredType::NATIVE_INT, dataspace);
dataset.write(&quad, PredType::NATIVE_INT);
}
// partialReadout
// readNRows
{
DataSpace dataspace = DataSpace(H5S_SCALAR);
DataSet dataset = group->createDataSet(
"Partial readout (rows)", PredType::NATIVE_INT, dataspace);
dataset.write(&partialReadout, PredType::NATIVE_INT);
"Number of rows", PredType::NATIVE_INT, dataspace);
dataset.write(&readNRows, PredType::NATIVE_INT);
}
// Rate corrections
{