mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
progress changed to double
This commit is contained in:
parent
28ffad223d
commit
de69e666a9
@ -19,7 +19,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
~qDrawPlot();
|
~qDrawPlot();
|
||||||
bool GetIsRunning();
|
bool GetIsRunning();
|
||||||
void SetRunning(bool enable);
|
void SetRunning(bool enable);
|
||||||
int GetProgress();
|
double GetProgress();
|
||||||
int64_t GetCurrentFrameIndex();
|
int64_t GetCurrentFrameIndex();
|
||||||
void Select1dPlot(bool enable);
|
void Select1dPlot(bool enable);
|
||||||
void SetPlotTitlePrefix(QString title);
|
void SetPlotTitlePrefix(QString title);
|
||||||
@ -152,7 +152,7 @@ class qDrawPlot : public QWidget, private Ui::PlotObject {
|
|||||||
bool disableZoom{false};
|
bool disableZoom{false};
|
||||||
int numDiscardBits{0};
|
int numDiscardBits{0};
|
||||||
|
|
||||||
int progress{0};
|
double progress{0};
|
||||||
int64_t currentFrame{0};
|
int64_t currentFrame{0};
|
||||||
mutable std::mutex mPlots;
|
mutable std::mutex mPlots;
|
||||||
int64_t currentAcqIndex{0};
|
int64_t currentAcqIndex{0};
|
||||||
|
@ -248,7 +248,7 @@ bool qDrawPlot::GetIsRunning() { return isRunning; }
|
|||||||
|
|
||||||
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
||||||
|
|
||||||
int qDrawPlot::GetProgress() { return progress; }
|
double qDrawPlot::GetProgress() { return progress; }
|
||||||
|
|
||||||
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
||||||
|
|
||||||
@ -717,7 +717,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
|||||||
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||||
} else {
|
} else {
|
||||||
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||||
<< ", Progress: " << currentProgress << " ]";
|
<< ", Progress: " << currentProgress << "% ]";
|
||||||
}
|
}
|
||||||
emit AcquireFinishedSignal();
|
emit AcquireFinishedSignal();
|
||||||
}
|
}
|
||||||
@ -741,10 +741,10 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
|||||||
<< " \t complete image: " << data->completeImage << std::endl
|
<< " \t complete image: " << data->completeImage << std::endl
|
||||||
<< " ]";
|
<< " ]";
|
||||||
|
|
||||||
progress = (int)data->progressIndex;
|
progress = data->progressIndex;
|
||||||
currentAcqIndex = data->fileIndex;
|
currentAcqIndex = data->fileIndex;
|
||||||
currentFrame = frameIndex;
|
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)
|
// 1d check if npixelX has changed (m3 for different counters enabled)
|
||||||
|
@ -464,7 +464,7 @@ void DetectorImpl::readFrameFromReceiver() {
|
|||||||
std::string currentFileName;
|
std::string currentFileName;
|
||||||
uint64_t currentAcquisitionIndex = -1, currentFrameIndex = -1,
|
uint64_t currentAcquisitionIndex = -1, currentFrameIndex = -1,
|
||||||
currentFileIndex = -1;
|
currentFileIndex = -1;
|
||||||
int currentProgress = -1;
|
double currentProgress = 0.00;
|
||||||
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
|
uint32_t currentSubFrameIndex = -1, coordX = -1, coordY = -1,
|
||||||
flippedDataX = -1;
|
flippedDataX = -1;
|
||||||
|
|
||||||
@ -1074,8 +1074,8 @@ int DetectorImpl::acquire() {
|
|||||||
if (acquisition_finished != nullptr) {
|
if (acquisition_finished != nullptr) {
|
||||||
int status = Parallel(&Module::getRunStatus, {}).squash(ERROR);
|
int status = Parallel(&Module::getRunStatus, {}).squash(ERROR);
|
||||||
auto a = Parallel(&Module::getReceiverProgress, {});
|
auto a = Parallel(&Module::getReceiverProgress, {});
|
||||||
int progress = (*std::min_element(a.begin(), a.end()));
|
double progress = (*std::min_element(a.begin(), a.end()));
|
||||||
acquisition_finished((double)progress, status, acqFinished_p);
|
acquisition_finished(progress, status, acqFinished_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
sem_destroy(&sem_newRTAcquisition);
|
sem_destroy(&sem_newRTAcquisition);
|
||||||
|
@ -429,8 +429,8 @@ slsDetectorDefs::runStatus Module::getReceiverStatus() const {
|
|||||||
return sendToReceiver<runStatus>(F_GET_RECEIVER_STATUS);
|
return sendToReceiver<runStatus>(F_GET_RECEIVER_STATUS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Module::getReceiverProgress() const {
|
double Module::getReceiverProgress() const {
|
||||||
return sendToReceiver<int>(F_GET_RECEIVER_PROGRESS);
|
return sendToReceiver<double>(F_GET_RECEIVER_PROGRESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t Module::getFramesCaughtByReceiver() const {
|
int64_t Module::getFramesCaughtByReceiver() const {
|
||||||
|
@ -162,7 +162,7 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void startAndReadAll();
|
void startAndReadAll();
|
||||||
runStatus getRunStatus() const;
|
runStatus getRunStatus() const;
|
||||||
runStatus getReceiverStatus() const;
|
runStatus getReceiverStatus() const;
|
||||||
int getReceiverProgress() const;
|
double getReceiverProgress() const;
|
||||||
int64_t getFramesCaughtByReceiver() const;
|
int64_t getFramesCaughtByReceiver() const;
|
||||||
std::vector<uint64_t> getNumMissingPackets() const;
|
std::vector<uint64_t> getNumMissingPackets() const;
|
||||||
uint64_t getStartingFrameNumber() const;
|
uint64_t getStartingFrameNumber() const;
|
||||||
|
@ -1538,7 +1538,7 @@ int ClientInterface::get_additional_json_parameter(Interface &socket) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ClientInterface::get_progress(Interface &socket) {
|
int ClientInterface::get_progress(Interface &socket) {
|
||||||
int retval = impl()->getProgress();
|
double retval = impl()->getProgress();
|
||||||
LOG(logDEBUG1) << "progress retval: " << retval;
|
LOG(logDEBUG1) << "progress retval: " << retval;
|
||||||
return socket.sendResult(retval);
|
return socket.sendResult(retval);
|
||||||
}
|
}
|
||||||
|
@ -449,7 +449,7 @@ uint64_t Implementation::getAcquisitionIndex() const {
|
|||||||
return min;
|
return min;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Implementation::getProgress() const {
|
double Implementation::getProgress() const {
|
||||||
// get minimum of processed frame indices
|
// get minimum of processed frame indices
|
||||||
uint64_t currentFrameIndex = -1;
|
uint64_t currentFrameIndex = -1;
|
||||||
uint32_t flagsum = 0;
|
uint32_t flagsum = 0;
|
||||||
|
@ -79,7 +79,7 @@ class Implementation : private virtual slsDetectorDefs {
|
|||||||
runStatus getStatus() const;
|
runStatus getStatus() const;
|
||||||
uint64_t getFramesCaught() const;
|
uint64_t getFramesCaught() const;
|
||||||
uint64_t getAcquisitionIndex() const;
|
uint64_t getAcquisitionIndex() const;
|
||||||
int getProgress() const;
|
double getProgress() const;
|
||||||
std::vector<uint64_t> getNumMissingPackets() const;
|
std::vector<uint64_t> getNumMissingPackets() const;
|
||||||
void startReceiver();
|
void startReceiver();
|
||||||
void setStoppedFlag(bool stopped);
|
void setStoppedFlag(bool stopped);
|
||||||
|
@ -41,7 +41,7 @@ struct zmqHeader {
|
|||||||
/** frame index (starting at 0 for each acquisition) */
|
/** frame index (starting at 0 for each acquisition) */
|
||||||
uint64_t frameIndex{0};
|
uint64_t frameIndex{0};
|
||||||
/** progress in percentage */
|
/** progress in percentage */
|
||||||
int progress{0};
|
double progress{0};
|
||||||
/** file name prefix */
|
/** file name prefix */
|
||||||
std::string fname;
|
std::string fname;
|
||||||
/** header from detector */
|
/** header from detector */
|
||||||
|
@ -99,7 +99,7 @@ int ZmqSocket::SendHeader(int index, zmqHeader header) {
|
|||||||
"\"size\":%u, "
|
"\"size\":%u, "
|
||||||
"\"acqIndex\":%lu, "
|
"\"acqIndex\":%lu, "
|
||||||
"\"frameIndex\":%lu, "
|
"\"frameIndex\":%lu, "
|
||||||
"\"progress\":%u, "
|
"\"progress\":%lf, "
|
||||||
"\"fname\":\"%s\", "
|
"\"fname\":\"%s\", "
|
||||||
"\"data\": %d, "
|
"\"data\": %d, "
|
||||||
"\"completeImage\": %d, "
|
"\"completeImage\": %d, "
|
||||||
@ -245,7 +245,7 @@ int ZmqSocket::ParseHeader(const int index, int length, char *buff,
|
|||||||
zHeader.imageSize = document["size"].GetUint();
|
zHeader.imageSize = document["size"].GetUint();
|
||||||
zHeader.acqIndex = document["acqIndex"].GetUint64();
|
zHeader.acqIndex = document["acqIndex"].GetUint64();
|
||||||
zHeader.frameIndex = document["frameIndex"].GetUint64();
|
zHeader.frameIndex = document["frameIndex"].GetUint64();
|
||||||
zHeader.progress = document["progress"].GetUint();
|
zHeader.progress = document["progress"].GetDouble();
|
||||||
zHeader.fname = document["fname"].GetString();
|
zHeader.fname = document["fname"].GetString();
|
||||||
|
|
||||||
zHeader.frameNumber = document["frameNumber"].GetUint64();
|
zHeader.frameNumber = document["frameNumber"].GetUint64();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user