This repository was archived by the owner on Apr 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.h
More file actions
108 lines (84 loc) · 2.42 KB
/
Copy pathmainwindow.h
File metadata and controls
108 lines (84 loc) · 2.42 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QCamera>
#include <QCameraInfo>
#include <QCameraViewfinder>
#include <QCameraViewfinderSettings>
#include <QPushButton>
#include <QCameraImageCapture>
#include <QComboBox>
#include <QLabel>
#include <QTimer>
#include <QImage>
#include <QVideoWidget>
#include <QRect>
#include <QSlider>
#include <QTime>
#include <QPainter>
#include <QBitmap>
#include <QVideoFrame>
#include <videosurface.h>
#include <QVector>
#include <QCheckBox>
#include <calibration.h>
#include <QEventLoop>
#include <QThread>
#include <worker.h>
#include <QMetaType>
#include <QProcess>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
int _ms = 100;
int xAvgR = 0, yAvgR = 0, xAvgL = 0, yAvgL = 0, widthR, heightR, widthL, heightL;
bool convertFinished = false, calibFinished = false, isFieldLocked = false, pressedR = false, pressedL = false;
double fps1, fps2, fps3;
QCamera* camera;
QVideoWidget* viewfinder;
QCameraImageCapture* imageCapture;
QPushButton* btnStartCamera;
QPushButton* btnStopCamera;
QPushButton* btnLockField;
QPushButton* btnRestartCalib;
QPushButton* btnTestLaunchL;
QPushButton* btnTestLaunchR;
QCheckBox* ckbB910Fix;
QComboBox* cmbResolution;
QLabel* resLabel;
QLabel* brightnessLabel;
QLabel* frameInfoLabel;
QLabel* overlayLabel;
QLabel* bwImageLabel;
QLabel* averageLabel;
QLabel* averageLabelOverlay;
QSlider* sldBrightness;
QTime timer;
QCameraViewfinderSettings viewfinderSettings;
VideoSurface* surface;
Worker* worker;
QThread* workerThread;
QPainter p;
QProcess* process;
QPixmap cFrame;
QPixmap cOverlay;
void checkCameras();
void closeEvent(QCloseEvent *event);
void paintEvent(QPaintEvent *event);
public slots:
void startCamera();
void updateRes();
void convertFrame(QImage frame);
void updateUI(QPixmap frame, QPixmap overlay, int xAvgR_t, int yAvgR_t, int xAvgL_t, int yAvgL_t);
void restartCalib();
void launchApplicationL();
void launchApplicationR();
void fieldLocked(int xAvgR_t, int yAvgR_t, int xAvgL_t, int yAvgL_t, int widthR, int heightR, int widthL_t, int heightL_t);
void fieldUnLocked();
signals:
void startThread(QImage frame, int separator, bool B910Fix);
void resChanged(double resRatioX, double resRatioY);
};
#endif // MAINWINDOW_H