mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
gui crash qtimer (#551)
* locks when qtimer runs out same time as acquisitionfinished * fix for newer gcc
This commit is contained in:
@ -254,13 +254,17 @@ void qDrawPlot::resizeEvent(QResizeEvent *event) {
|
||||
|
||||
bool qDrawPlot::GetIsRunning() { return isRunning; }
|
||||
|
||||
void qDrawPlot::SetRunning(bool enable) { isRunning = enable; }
|
||||
void qDrawPlot::SetRunning(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
isRunning = enable;
|
||||
}
|
||||
|
||||
double qDrawPlot::GetProgress() { return progress; }
|
||||
|
||||
int64_t qDrawPlot::GetCurrentFrameIndex() { return currentFrame; }
|
||||
|
||||
void qDrawPlot::Select1dPlot(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
if (enable) {
|
||||
is1d = true;
|
||||
// DetachHists(); it clears the last measurement
|
||||
@ -487,6 +491,7 @@ void qDrawPlot::EnableGainPlot(bool enable) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetSaveFileName(QString val) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
LOG(logDEBUG) << "Setting Clone/Save File Name to "
|
||||
<< val.toAscii().constData();
|
||||
fileSaveName = val;
|
||||
@ -592,6 +597,7 @@ void qDrawPlot::ClonePlot() {
|
||||
}
|
||||
|
||||
void qDrawPlot::SavePlot() {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
// render image
|
||||
QImage savedImage(size().width(), size().height(), QImage::Format_RGB32);
|
||||
QPainter painter(&savedImage);
|
||||
|
@ -865,6 +865,7 @@ void qTabMeasurement::SetNextFrameNumber(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::ResetProgress() {
|
||||
std::lock_guard<std::mutex> lock(mProgress);
|
||||
LOG(logDEBUG) << "Resetting progress";
|
||||
lblCurrentFrame->setText("0");
|
||||
lblCurrentMeasurement->setText("0");
|
||||
@ -873,6 +874,7 @@ void qTabMeasurement::ResetProgress() {
|
||||
|
||||
void qTabMeasurement::UpdateProgress() {
|
||||
LOG(logDEBUG) << "Updating progress";
|
||||
std::lock_guard<std::mutex> lock(mProgress);
|
||||
progressBar->setValue(plot->GetProgress());
|
||||
lblCurrentFrame->setText(QString::number(plot->GetCurrentFrameIndex()));
|
||||
lblCurrentMeasurement->setText(QString::number(currentMeasurement));
|
||||
@ -920,7 +922,6 @@ void qTabMeasurement::StartAcquisition() {
|
||||
currentMeasurement = 0;
|
||||
ResetProgress();
|
||||
Enable(0);
|
||||
progressBar->setValue(0);
|
||||
progressTimer->start(100);
|
||||
emit EnableTabsSignal(false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user