diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index d6d73a42d..3c3b43873 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -19,7 +19,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject { ~qDrawPlot(); bool GetIsRunning(); void SetRunning(bool enable); - int GetProgress(); + double GetProgress(); int64_t GetCurrentFrameIndex(); void Select1dPlot(bool enable); void SetPlotTitlePrefix(QString title); @@ -152,7 +152,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject { bool disableZoom{false}; int numDiscardBits{0}; - int progress{0}; + double progress{0}; int64_t currentFrame{0}; mutable std::mutex mPlots; int64_t currentAcqIndex{0}; diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 7a553abe6..9f493787a 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -248,7 +248,7 @@ bool qDrawPlot::GetIsRunning() { return isRunning; } void qDrawPlot::SetRunning(bool enable) { isRunning = enable; } -int qDrawPlot::GetProgress() { return progress; } +double qDrawPlot::GetProgress() { return progress; } int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; } @@ -717,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress, LOG(logERROR) << "Acquisition finished [Status: ERROR]"; } else { LOG(logINFO) << "Acquisition finished [ Status:" << status - << ", Progress: " << currentProgress << " ]"; + << ", Progress: " << currentProgress << "% ]"; } emit AcquireFinishedSignal(); } @@ -741,10 +741,10 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, << " \t complete image: " << data->completeImage << std::endl << " ]"; - progress = (int)data->progressIndex; + progress = data->progressIndex; currentAcqIndex = data->fileIndex; currentFrame = frameIndex; - LOG(logDEBUG) << "[ Progress:" << progress << ", Frame:" << currentFrame + LOG(logDEBUG) << "[ Progress:" << progress << "%, Frame:" << currentFrame << " ]"; // 1d check if npixelX has changed (m3 for different counters enabled) diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 95f7a7eb1..b3e163d32 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -464,7 +464,7 @@ void DetectorImpl::readFrameFromReceiver() { std::string currentFileName; uint64_t currentAcquisitionIndex = -1, currentFrameIndex = -1, currentFileIndex = -1; - int currentProgress = -1; + double currentProgress = 0.00; uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1, flippedDataX = -1; @@ -1074,8 +1074,8 @@ int DetectorImpl::acquire() { if (acquisition_finished != nullptr) { int status = Parallel(&Module::getRunStatus, {}).squash(ERROR); auto a = Parallel(&Module::getReceiverProgress, {}); - int progress = (*std::min_element(a.begin(), a.end())); - acquisition_finished((double)progress, status, acqFinished_p); + double progress = (*std::min_element(a.begin(), a.end())); + acquisition_finished(progress, status, acqFinished_p); } sem_destroy(&sem_newRTAcquisition); diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 7bb36c449..18ecf7fd5 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -429,8 +429,8 @@ slsDetectorDefs::runStatus Module::getReceiverStatus() const { return sendToReceiver(F_GET_RECEIVER_STATUS); } -int Module::getReceiverProgress() const { - return sendToReceiver(F_GET_RECEIVER_PROGRESS); +double Module::getReceiverProgress() const { + return sendToReceiver(F_GET_RECEIVER_PROGRESS); } int64_t Module::getFramesCaughtByReceiver() const { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index f3dcbbb2a..bc4a36d16 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -162,7 +162,7 @@ class Module : public virtual slsDetectorDefs { void startAndReadAll(); runStatus getRunStatus() const; runStatus getReceiverStatus() const; - int getReceiverProgress() const; + double getReceiverProgress() const; int64_t getFramesCaughtByReceiver() const; std::vector getNumMissingPackets() const; uint64_t getStartingFrameNumber() const; diff --git a/slsReceiverSoftware/src/ClientInterface.cpp b/slsReceiverSoftware/src/ClientInterface.cpp index 157fa19b8..eababfbf2 100644 --- a/slsReceiverSoftware/src/ClientInterface.cpp +++ b/slsReceiverSoftware/src/ClientInterface.cpp @@ -1538,7 +1538,7 @@ int ClientInterface::get_additional_json_parameter(Interface &socket) { } int ClientInterface::get_progress(Interface &socket) { - int retval = impl()->getProgress(); + double retval = impl()->getProgress(); LOG(logDEBUG1) << "progress retval: " << retval; return socket.sendResult(retval); } diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 246aa4e7f..7600a194d 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -449,7 +449,7 @@ uint64_t Implementation::getAcquisitionIndex() const { return min; } -int Implementation::getProgress() const { +double Implementation::getProgress() const { // get minimum of processed frame indices uint64_t currentFrameIndex = -1; uint32_t flagsum = 0; diff --git a/slsReceiverSoftware/src/Implementation.h b/slsReceiverSoftware/src/Implementation.h index be0ba708c..aa1949afe 100644 --- a/slsReceiverSoftware/src/Implementation.h +++ b/slsReceiverSoftware/src/Implementation.h @@ -79,7 +79,7 @@ class Implementation : private virtual slsDetectorDefs { runStatus getStatus() const; uint64_t getFramesCaught() const; uint64_t getAcquisitionIndex() const; - int getProgress() const; + double getProgress() const; std::vector getNumMissingPackets() const; void startReceiver(); void setStoppedFlag(bool stopped); diff --git a/slsSupportLib/include/ZmqSocket.h b/slsSupportLib/include/ZmqSocket.h index b52a3f876..ae561afe9 100644 --- a/slsSupportLib/include/ZmqSocket.h +++ b/slsSupportLib/include/ZmqSocket.h @@ -41,7 +41,7 @@ struct zmqHeader { /** frame index (starting at 0 for each acquisition) */ uint64_t frameIndex{0}; /** progress in percentage */ - int progress{0}; + double progress{0}; /** file name prefix */ std::string fname; /** header from detector */ diff --git a/slsSupportLib/src/ZmqSocket.cpp b/slsSupportLib/src/ZmqSocket.cpp index 02a64724c..54b6970a4 100644 --- a/slsSupportLib/src/ZmqSocket.cpp +++ b/slsSupportLib/src/ZmqSocket.cpp @@ -99,7 +99,7 @@ int ZmqSocket::SendHeader(int index, zmqHeader header) { "\"size\":%u, " "\"acqIndex\":%lu, " "\"frameIndex\":%lu, " - "\"progress\":%u, " + "\"progress\":%lf, " "\"fname\":\"%s\", " "\"data\": %d, " "\"completeImage\": %d, " @@ -245,7 +245,7 @@ int ZmqSocket::ParseHeader(const int index, int length, char *buff, zHeader.imageSize = document["size"].GetUint(); zHeader.acqIndex = document["acqIndex"].GetUint64(); zHeader.frameIndex = document["frameIndex"].GetUint64(); - zHeader.progress = document["progress"].GetUint(); + zHeader.progress = document["progress"].GetDouble(); zHeader.fname = document["fname"].GetString(); zHeader.frameNumber = document["frameNumber"].GetUint64();