#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include "serialworker.h" #include "rawview.h" #include "tableview.h" #include "tagwidget.h" #include "videowidget.h" #include "connectdialog.h" #include "sendbar.h" class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); protected: void closeEvent(QCloseEvent *event) override; private slots: void onConnectClicked(); void onDisconnectClicked(); void onPortOpened(); void onPortClosed(); void onReconnecting(int attempt); void onClearScreen(); void onError(const QString &message); void onNewLine(const QString &line); void onTagDetected(const QString &tag, const QString &value); void onScreenshotRequested(const QString &filename); void showFormatReference(); void configureTagFilter(); void configureScreenshotDir(); void configureReconnectInterval(); void showAbout(); private: void setupUi(); void setupToolBar(); void setupMenuBar(); void setupStatusBar(); void clearAllViews(); void doShutdown(); void saveSettings(); void restoreSettings(); void updateScreenshotDirTooltip(); QThread *m_thread = nullptr; SerialWorker *m_worker = nullptr; RawView *m_rawView = nullptr; TableView *m_tableView = nullptr; TagWidget *m_tagWidget = nullptr; VideoWidget *m_videoWidget= nullptr; SendBar *m_sendBar = nullptr; QLabel *m_portLabel = nullptr; QLabel *m_stateLabel = nullptr; QLabel *m_reconnectLabel = nullptr; QAction *m_autoReconnectAction = nullptr; int m_reconnectIntervalMs = 2000; QAction *m_connectAction = nullptr; QAction *m_disconnectAction = nullptr; QAction *m_screenshotDirAction = nullptr; // Splitters (saved/restored via QSettings) QSplitter *m_mainSplitter = nullptr; QSplitter *m_rightSplitter = nullptr; SerialConfig m_lastConfig; QSet m_suppressedTags; // tags hidden from Raw view QString m_screenshotDir; // target folder for [SCREENSHOT] tag captures // Remembered folders for the *manual* "Screenshot"/"Record" toolbar // buttons in VideoWidget (distinct from m_screenshotDir above, which is // only for the firmware-triggered [SCREENSHOT] tag) - so the save // dialogs reopen wherever the user last saved to instead of always // resetting to Pictures/Videos. QString m_lastManualScreenshotDir; QString m_lastVideoDir; bool m_shutdownDone = false; };