66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
#ifndef VRVIRTUALCAMERAWIDGET_H
|
|
#define VRVIRTUALCAMERAWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QTextEdit>
|
|
#include <QSpinBox>
|
|
#include <QLineEdit>
|
|
#include <QTimer>
|
|
|
|
class VrCameraSimulator;
|
|
|
|
/// Main window for the virtual camera application.
|
|
class VrVirtualCameraWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit VrVirtualCameraWidget(QWidget* parent = nullptr);
|
|
~VrVirtualCameraWidget() override;
|
|
|
|
private slots:
|
|
void OnStartStop();
|
|
void OnFrameRateChanged(int fps);
|
|
void OnWidthChanged(int w);
|
|
void OnHeightChanged(int h);
|
|
void OnBrowseImageDir();
|
|
void OnBrowseLaserDir();
|
|
|
|
void OnSimulatorImage(const QImage& left, const QImage& right);
|
|
void OnSimulatorLog(const QString& msg, bool isWarning);
|
|
void OnSimulatorStatus(const QString& status);
|
|
void OnSimulatorClientConnected(const QString& ip);
|
|
void OnSimulatorClientDisconnected();
|
|
void OnImageDirectoryChanged(int count);
|
|
void OnLaserDirectoryChanged(int fileCount, int totalLines);
|
|
|
|
private:
|
|
void InitUI();
|
|
void ApplyConfig();
|
|
void AppendLog(const QString& msg, bool isWarning = false);
|
|
|
|
VrCameraSimulator* m_simulator = nullptr;
|
|
|
|
// UI elements
|
|
QLabel* m_statusLabel = nullptr;
|
|
QLabel* m_clientLabel = nullptr;
|
|
QLabel* m_leftImageLabel = nullptr;
|
|
QLabel* m_rightImageLabel = nullptr;
|
|
QPushButton* m_startStopBtn = nullptr;
|
|
QSpinBox* m_fpsSpinBox = nullptr;
|
|
QSpinBox* m_widthSpinBox = nullptr;
|
|
QSpinBox* m_heightSpinBox = nullptr;
|
|
QLineEdit* m_ipLineEdit = nullptr;
|
|
QLineEdit* m_imageDirEdit = nullptr;
|
|
QLineEdit* m_laserDirEdit = nullptr;
|
|
QLabel* m_imageCountLabel = nullptr;
|
|
QLabel* m_laserCountLabel = nullptr;
|
|
QTextEdit* m_logEdit = nullptr;
|
|
|
|
bool m_running = false;
|
|
};
|
|
|
|
#endif // VRVIRTUALCAMERAWIDGET_H
|