gui crash qtimer (#551)

* locks when qtimer runs out same time as acquisitionfinished

* fix for newer gcc
This commit is contained in:
Dhanya Thattil
2022-09-16 17:02:03 +02:00
committed by GitHub
parent 1df4aba8ec
commit e385618d09
5 changed files with 15 additions and 2 deletions

View File

@ -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);