-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathfoucaultview.h
More file actions
120 lines (104 loc) · 3.41 KB
/
foucaultview.h
File metadata and controls
120 lines (104 loc) · 3.41 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#ifndef FOUCAULTVIEW_H
#define FOUCAULTVIEW_H
#include <QWidget>
#include <QImage>
#include <QPainter>
#include <QMessageBox>
#include <QTimer>
#include <opencv2/opencv.hpp>
#include "surfacemanager.h"
// Enum to specify which optical test to simulate
enum class OpticalTestType {
Foucault,
Ronchi
};
enum class GridMode { None, Inches, Millimeters, Percentage };
// Parameter container so this can be called without needing the UI pointers
struct OpticalTestSettings {
double rocOffset = 0.0;
double ronchiX = 1.0;
double lpi = 100.0;
double gamma = 1.0;
double slitWidth = 0.001;
bool useMM = true;
bool movingSource = true;
bool knifeOnLeft = false;
bool clearCenter = false;
// Internal state variables used by the original logic
int heightMultiply = 1;
int lateralOffset = 0;
double outputLambda = 550.0;
};
namespace Ui {
class foucaultView;
}
class foucaultView : public QWidget
{
Q_OBJECT
public:
static foucaultView *get_Instance(SurfaceManager *sm = 0);
foucaultView(const foucaultView&) = delete;
foucaultView& operator=(const foucaultView&) = delete;
~foucaultView();
void setSurface(wavefront * wf);
bool saveOnlyFoucault();
bool needsDrawing;
// The Refactored Static Engine - Callable from other classes
static QImage generateOpticalTestImage(OpticalTestType type, wavefront* wf, const OpticalTestSettings& settings, bool bAutoCollimate);
public slots:
void on_makePb_clicked();
QImage *render();
private slots:
void showContextMenu(QPoint pos);
void on_gammaSb_valueChanged(double arg1);
void on_lpiSb_valueChanged(double arg1);
void on_movingSourceRb_clicked(bool /*unused*/);
void on_radioButton_2_clicked();
void on_knifeOnLeftCb_clicked();
void on_lpiSb_editingFinished();
void on_rocOffsetSb_editingFinished();
void on_slitWidthSb_editingFinished();
void on_useMM_clicked(bool checked);
void on_scanPb_clicked();
void on_h1x_clicked();
void on_h2x_clicked();
void on_h4x_clicked();
void on_rocOffsetSlider_valueChanged(int value);
void on_clearCenterCb_clicked();
void on_autoStepSize_clicked(bool checked);
void on_rocStepSize_editingFinished();
void on_lateralOffset_valueChanged(int arg1);
void on_SaveImageCB_clicked(bool checked);
void saveRonchiImage();
void saveFoucaultImage();
void showGrid();
void on_overlayProfile_stateChanged(int arg1);
void on_RonchiX_valueChanged(double arg1);
void on_pushButton_clicked();
void on_autocollimation_clicked(bool checked);
void showSelectedRonchiImages();
void generateBatchRonchiImage(const QList<wavefront*>& wavefrontList);
private:
Ui::foucaultView *ui;
SurfaceManager *m_sm;
QString imageDir;
QImage m_foucaultQimage;
QTimer m_guiTimer;
int heightMultiply;
double m_sag;
double m_temp_sag;
wavefront *m_wf;
int lateralOffset;
GridMode m_gridMode = GridMode::None;
double m_gridSpacing = 10.0; // Default spacing value
int m_gridLineWidth = 1;
bool m_showUnitLabels = true;
QColor m_gridColor = Qt::cyan;
QColor m_textColor = Qt::white;
void drawGridOverlay(QImage &img);
explicit foucaultView(QWidget *parent = 0, SurfaceManager *sm = 0);
cv::Mat compute_star_test(int pupil_size, double defocus, double pad, bool use_OPD);
double getStep();
void draw_ROC_Scale();
};
#endif // FOUCAULTVIEW_H