Skip to content
Snippets Groups Projects
Commit 2b604025 authored by mingf2's avatar mingf2
Browse files

fix bug in stop and exit

parent fa4eac03
No related branches found
No related tags found
No related merge requests found
Demo/Demo.gif

9 MiB

#ifndef WORKER_H
#define WORKER_H
#include <atomic>
#include <QObject>
#include <QThread>
#include "reconstruction.h"
......@@ -12,15 +13,18 @@ class Worker : public QThread
RecoImage* image;
void run() override;
ulong localCounts=0;
bool stopped=true;
bool exitted=false;
std::atomic<bool> stopped;
std::atomic<bool> exitted;
public:
// explicit Worker(QObject *parent = nullptr);
Worker(QObject *parent, const Setup* config_, RecoImage* image_) :
QThread(parent),
config(config_),
image(image_)
{}
{
stopped=true;
exitted=false;
}
//signals:
......
# Simple GUI application for back projection image reconstruction
## Use
- Install [ROOT](https://root.cern/install/) (v6.22 or above), `qmake` and `make`.
- Compile:
## Prerequisites
- Install [ROOT v6](https://root.cern/install/).
- Install qt5 development packages
```bash
sudo apt-get install qt5-default qtdeclarative5-dev
```
## Build
```bash
mkdir -p build
cd build
qmake CONFIG+=realease ../imagerQt.pro
qmake -config release ../imagerQt.pro
make
```
- Run:
## Run
```bash
cd ..
build/ImagerQt
......
......@@ -58,6 +58,7 @@ void Worker::handleStop()
void Worker::stopExecution()
{
exitted = true;
qDebug() << "Exiting thread signal received.";
}
void Worker::handleClear()
......
......@@ -71,6 +71,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
DISTFILES += \
.gitignore \
Demo/Demo.gif \
README.md
RESOURCES += \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment