ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1
23
24#ifndef MAINWINDOW_H
25#define MAINWINDOW_H
26
27#include "acquisitionworker.h"
28#include "display.h"
29
30#include <peak_ipl/peak_ipl.hpp>
31
32#include <peak/peak.hpp>
33
34#include <QBoxLayout>
35#include <QLabel>
36#include <QMainWindow>
37#include <QMessageBox>
38#include <QPushButton>
39#include <QThread>
40#include <QWidget>
41#include <QVBoxLayout>
42#include <QHBoxLayout>
43
44#include <cstdint>
45
46
47class MainWindow : public QMainWindow
48{
49 Q_OBJECT
50
51public:
52 explicit MainWindow(QWidget* parent = nullptr);
53 ~MainWindow() override;
54
55private:
56 std::shared_ptr<peak::core::Device> m_device;
57 std::shared_ptr<peak::core::DataStream> m_dataStream;
58 std::shared_ptr<peak::core::NodeMap> m_nodemapRemoteDevice;
59
61 QLabel* m_labelInfo{};
62 QLabel* m_labelVersion{};
63 QPushButton* m_buttonSave{};
64 QLabel* m_labelAboutQt{};
65
66 QVBoxLayout* m_layout{};
67 QHBoxLayout* m_controls{};
68
70 QThread m_acquisitionThread;
71
72 std::mutex m_writeMutex;
73
74 void DestroyAll();
75
76 bool OpenDevice();
78
79 std::string selectSaveFileWithDialog();
80
81public slots:
82 void SaveImage();
83 void onCounterChanged(unsigned int frameCounter, unsigned int errorCounter);
84 void onAboutQtLinkActivated(const QString& link);
85};
86
87#endif // MAINWINDOW_H
Definition acquisitionworker.h:41
Definition display.h:57
Definition mainwindow.h:47
QPushButton * m_buttonSave
Definition mainwindow.h:63
void onCounterChanged(unsigned int frameCounter, unsigned int errorCounter)
Definition mainwindow.cpp:406
std::string selectSaveFileWithDialog()
Definition mainwindow.cpp:315
~MainWindow() override
QLabel * m_labelAboutQt
Definition mainwindow.h:64
QHBoxLayout * m_controls
Definition mainwindow.h:67
QLabel * m_labelVersion
Definition mainwindow.h:62
QThread m_acquisitionThread
Definition mainwindow.h:72
void CloseDevice()
std::shared_ptr< peak::core::DataStream > m_dataStream
Definition mainwindow.h:57
QVBoxLayout * m_layout
Definition mainwindow.h:66
void onAboutQtLinkActivated(const QString &link)
Definition mainwindow.cpp:412
std::shared_ptr< peak::core::NodeMap > m_nodemapRemoteDevice
Definition mainwindow.h:58
std::mutex m_writeMutex
Definition mainwindow.h:72
MainWindow(QWidget *parent=nullptr)
void DestroyAll()
Definition mainwindow.cpp:128
bool OpenDevice()
void SaveImage()
Definition mainwindow.cpp:352
AcquisitionWorker * m_acquisitionWorker
Definition mainwindow.h:71
std::unique_ptr< Device > m_device
Definition mainwindow.h:58
CustomDisplay * m_display
Definition mainwindow.h:64
QLabel * m_labelInfo
Definition mainwindow.h:65
The AcquisitionWorker class is used in a worker thread to capture images from the device continuously...
The Display class implements an easy way to display images from a camera in a QT widgets window....