merge from developer

This commit is contained in:
2022-01-17 11:58:22 +01:00
9 changed files with 130 additions and 29 deletions

View File

@ -480,9 +480,9 @@ double Implementation::getProgress() const {
((double)(currentFrameIndex + 1) / (double)numberOfTotalFrames));
}
std::vector<uint64_t> Implementation::getNumMissingPackets() const {
std::vector<uint64_t> mp(numUDPInterfaces);
for (int i = 0; i < numUDPInterfaces; i++) {
std::vector<int64_t> Implementation::getNumMissingPackets() const {
std::vector<int64_t> mp(numUDPInterfaces);
for (int i = 0; i < numUDPInterfaces; ++i) {
int np = generalData->packetsPerFrame;
uint64_t totnp = np;
// ReadNRows
@ -603,12 +603,7 @@ void Implementation::stopReceiver() {
LOG(logINFO) << "Status: " << sls::ToString(status);
{ // statistics
auto tmp = getNumMissingPackets();
// convert to signed missing packets (to get excess)
std::vector<int64_t> mp;
for (auto val : tmp) {
mp.push_back(static_cast<int64_t>(val));
}
auto mp = getNumMissingPackets();
// print summary
uint64_t tot = 0;
for (int i = 0; i < numUDPInterfaces; i++) {
@ -617,7 +612,7 @@ void Implementation::stopReceiver() {
std::string mpMessage = std::to_string(mp[i]);
if (mp[i] < 0) {
mpMessage =
std::to_string(abs(mp[i])) + std::string(" (Extra)");
std::to_string(std::abs(mp[i])) + std::string(" (Extra)");
}
TLogLevel lev = ((mp[i]) > 0) ? logINFORED : logINFOGREEN;

View File

@ -85,7 +85,7 @@ class Implementation : private virtual slsDetectorDefs {
uint64_t getFramesCaught() const;
uint64_t getAcquisitionIndex() const;
double getProgress() const;
std::vector<uint64_t> getNumMissingPackets() const;
std::vector<int64_t> getNumMissingPackets() const;
void setScan(slsDetectorDefs::scanParameters s);
void startReceiver();
void setStoppedFlag(bool stopped);

View File

@ -40,8 +40,8 @@ uint64_t Listener::GetLastFrameIndexCaught() const {
return lastCaughtFrameIndex;
}
uint64_t Listener::GetNumMissingPacket(bool stoppedFlag,
uint64_t numPackets) const {
int64_t Listener::GetNumMissingPacket(bool stoppedFlag,
uint64_t numPackets) const {
if (!stoppedFlag) {
return (numPackets - numPacketsCaught);
}

View File

@ -63,8 +63,8 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
*/
uint64_t GetLastFrameIndexCaught() const;
/** Get number of missing packets */
uint64_t GetNumMissingPacket(bool stoppedFlag, uint64_t numPackets) const;
/** Get number of missing packets, returns negative values in case to extra packet */
int64_t GetNumMissingPacket(bool stoppedFlag, uint64_t numPackets) const;
/**
* Set Fifo pointer to the one given