Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QCloseEvent>
#include "qrootcanvas.h"
#include "TH2D.h"
#include "TGraph.h"
#include "TText.h"
#include "worker.h"
#define SOURCE_X 3.6
#define SOURCE_Y -10.0
#define SOURCE_Z 0.0
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
virtual void changeEvent(QEvent *e);
~MainWindow();
// reconstruct images
void run();
void closeEvent (QCloseEvent *event);
bool aborted=false;
public slots:
private:
Ui::MainWindow *ui;
Setup* config;
SPSC* coneQueue;
TH2D* hist;
void createHist();
ULong64_t counts=0;
TText* countsText;
void createCountsLabel();
// gridlines
std::vector<TGraph*> latitudes;
std::vector<TGraph*> longitudes;
void aitoff2xy(const double& l, const double& b, double &Al, double &Ab);
void createGridlines();
void redraw();
// void createSourceMarker();
// worker thread responsible for image reconstruction
Worker* workerThread;
bool threadExecutionFinished=false;
bool finished=false;
bool stop=true;
// bool closed=false;
// void customClose();
// update image
void updateImage(std::vector<Cone>::const_iterator first,
std::vector<Cone>::const_iterator last,
const bool& normalized=true);
protected:
private slots:
void handleOpen();
void handleSave();
void handleSaveAs();
void handleClose();
void handleStart();
void handleStop();
void handleClear();
void handleAbout();
void notifyThreadFinished();
signals:
void threadStopped();
};
#endif // MAINWINDOW_H