Merge pull request #391 from slsdetectorgroup/missingsigned

signed num missing packets
This commit is contained in:
Dhanya Thattil 2022-02-23 09:01:43 +01:00 committed by GitHub
commit e29d73251e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 16 deletions

View File

@ -40,6 +40,7 @@ This document describes the differences between v7.0.0 and v6.x.x
- when in discard partial frames or empty mode, the frame number doesnt increase by 1, it increases to that number (so its faster) - when in discard partial frames or empty mode, the frame number doesnt increase by 1, it increases to that number (so its faster)
- file write disabled by default - file write disabled by default
- start non blocking acquisition at modular level - start non blocking acquisition at modular level
- missingpackets signed (negative => extra packets)
2. Resolved Issues 2. Resolved Issues

View File

@ -1911,7 +1911,7 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def rx_missingpackets(self): def rx_missingpackets(self):
"""Gets the number of missing packets for each port in receiver.""" """Gets the number of missing packets for each port in receiver. Negative number denotes extra packets. """
return self.getNumMissingPackets() return self.getNumMissingPackets()
""" """

View File

@ -490,11 +490,10 @@ void init_det(py::module &m) {
(Result<int64_t>(Detector::*)(sls::Positions) const) & (Result<int64_t>(Detector::*)(sls::Positions) const) &
Detector::getFramesCaught, Detector::getFramesCaught,
py::arg() = Positions{}) py::arg() = Positions{})
.def( .def("getNumMissingPackets",
"getNumMissingPackets", (Result<std::vector<int64_t>>(Detector::*)(sls::Positions) const) &
(Result<std::vector<uint64_t>>(Detector::*)(sls::Positions) const) & Detector::getNumMissingPackets,
Detector::getNumMissingPackets, py::arg() = Positions{})
py::arg() = Positions{})
.def("getNextFrameNumber", .def("getNextFrameNumber",
(Result<uint64_t>(Detector::*)(sls::Positions) const) & (Result<uint64_t>(Detector::*)(sls::Positions) const) &
Detector::getNextFrameNumber, Detector::getNextFrameNumber,

View File

@ -588,11 +588,9 @@ class Detector {
Result<int64_t> getFramesCaught(Positions pos = {}) const; Result<int64_t> getFramesCaught(Positions pos = {}) const;
/** Gets the number of missing packets for each port in receiver. /** Gets the number of missing packets for each port in receiver. Negative
* Troubleshoot: If they are large numbers, convert it to signed to get * number denotes extra packets. */
* number of access packets received */ Result<std::vector<int64_t>> getNumMissingPackets(Positions pos = {}) const;
Result<std::vector<uint64_t>>
getNumMissingPackets(Positions pos = {}) const;
/** [Eiger][Jungfrau][Moench][CTB] */ /** [Eiger][Jungfrau][Moench][CTB] */
Result<uint64_t> getNextFrameNumber(Positions pos = {}) const; Result<uint64_t> getNextFrameNumber(Positions pos = {}) const;

View File

@ -1536,7 +1536,8 @@ class CmdProxy {
"\n\tNumber of frames caught by receiver."); "\n\tNumber of frames caught by receiver.");
GET_COMMAND(rx_missingpackets, getNumMissingPackets, GET_COMMAND(rx_missingpackets, getNumMissingPackets,
"\n\tNumber of missing packets for each port in receiver."); "\n\tNumber of missing packets for each port in receiver. "
"Negative number denotes extra packets.");
INTEGER_COMMAND_VEC_ID( INTEGER_COMMAND_VEC_ID(
nextframenumber, getNextFrameNumber, setNextFrameNumber, nextframenumber, getNextFrameNumber, setNextFrameNumber,

View File

@ -797,7 +797,7 @@ Result<int64_t> Detector::getFramesCaught(Positions pos) const {
return pimpl->Parallel(&Module::getFramesCaughtByReceiver, pos); return pimpl->Parallel(&Module::getFramesCaughtByReceiver, pos);
} }
Result<std::vector<uint64_t>> Result<std::vector<int64_t>>
Detector::getNumMissingPackets(Positions pos) const { Detector::getNumMissingPackets(Positions pos) const {
return pimpl->Parallel(&Module::getNumMissingPackets, pos); return pimpl->Parallel(&Module::getNumMissingPackets, pos);
} }

View File

@ -870,7 +870,7 @@ int64_t Module::getFramesCaughtByReceiver() const {
return sendToReceiver<int64_t>(F_GET_RECEIVER_FRAMES_CAUGHT); return sendToReceiver<int64_t>(F_GET_RECEIVER_FRAMES_CAUGHT);
} }
std::vector<uint64_t> Module::getNumMissingPackets() const { std::vector<int64_t> Module::getNumMissingPackets() const {
// TODO!(Erik) Refactor // TODO!(Erik) Refactor
LOG(logDEBUG1) << "Getting num missing packets"; LOG(logDEBUG1) << "Getting num missing packets";
if (shm()->useReceiverFlag) { if (shm()->useReceiverFlag) {
@ -882,7 +882,7 @@ std::vector<uint64_t> Module::getNumMissingPackets() const {
" returned error: " + client.readErrorMessage()); " returned error: " + client.readErrorMessage());
} else { } else {
auto nports = client.Receive<int>(); auto nports = client.Receive<int>();
std::vector<uint64_t> retval(nports); std::vector<int64_t> retval(nports);
client.Receive(retval); client.Receive(retval);
LOG(logDEBUG1) << "Missing packets of Receiver" << moduleIndex LOG(logDEBUG1) << "Missing packets of Receiver" << moduleIndex
<< ": " << sls::ToString(retval); << ": " << sls::ToString(retval);

View File

@ -200,7 +200,7 @@ class Module : public virtual slsDetectorDefs {
runStatus getReceiverStatus() const; runStatus getReceiverStatus() const;
double getReceiverProgress() const; double getReceiverProgress() const;
int64_t getFramesCaughtByReceiver() const; int64_t getFramesCaughtByReceiver() const;
std::vector<uint64_t> getNumMissingPackets() const; std::vector<int64_t> getNumMissingPackets() const;
uint64_t getNextFrameNumber() const; uint64_t getNextFrameNumber() const;
void setNextFrameNumber(uint64_t value); void setNextFrameNumber(uint64_t value);
void sendSoftwareTrigger(const bool block); void sendSoftwareTrigger(const bool block);