#pragma once #include "APP/APP_KeypadModel.h" #include "LOGIC/Lgc_Core.h" #include #include #include #include class QLabel; class QComboBox; class QLineEdit; class QPlainTextEdit; class QPushButton; class QResizeEvent; class QSpinBox; class QStackedWidget; class QTabWidget; class QTableWidget; namespace APP { class APP_KeyButton; class App_UIWindow : public QWidget { public: explicit App_UIWindow(QWidget* parent = nullptr); ~App_UIWindow() override; protected: void paintEvent(QPaintEvent* event) override; void resizeEvent(QResizeEvent* event) override; bool nativeEvent(const QByteArray& EventType, void* p_Message, long* p_Result) override; private: void App_Func_InitWindow(); void App_Func_InitUi(); void App_Func_InitConnect(); void App_Func_InitLogic(); void App_Func_RefreshKeypadState(); void App_Func_RefreshKeypadButtons(); void App_Func_RefreshFeatureTable(); void App_Func_RefreshFunctionStatus(); void App_Func_RefreshPacketTestPanel(); void App_Func_RefreshPacketTestTable(); void App_Func_RefreshUi(); void App_Func_RefreshAfterLogicChange(); void App_Func_SelectFeature(int FeatureId, bool SwitchToFeaturePage = false); void App_Func_SaveFeatureFromUi(); void App_Func_UpdateFeatureEditorState(); void App_Func_UpdateFeatureEditorHeight(); void App_Func_AddFeature(); void App_Func_DeleteFeature(); void App_Func_ShowKeyMenu(quint16 Usage, const QPoint& GlobalPos); void App_Func_StartSequenceRecording(); void App_Func_StopSequenceRecording(); void App_Func_UpdateSequenceRecordingUi(); bool App_Func_HandleSequenceRecordMessage(void* p_Message); QWidget* App_Func_CreatePadCard(); QWidget* App_Func_CreateFunctionConfigCard(); QWidget* App_Func_CreatePacketTestCard(); APP_KeypadModel appKeypadModel; QHash appKeypadButtonMap; QTabWidget* appPageTab = nullptr; int appFeaturePageIndex = 0; int appPacketTestPageIndex = 0; QLabel* appFunctionLabelStatus = nullptr; QTableWidget* appFeatureTable = nullptr; QPushButton* appFeatureAddButton = nullptr; QPushButton* appFeatureDeleteButton = nullptr; QPushButton* appFeatureTimeSyncButton = nullptr; QPushButton* appFeatureThemeSwitchButton = nullptr; QLabel* appFeatureBindingSummaryLabel = nullptr; QLineEdit* appFeatureNameEdit = nullptr; QLineEdit* appFeatureDescriptionEdit = nullptr; QComboBox* appFeatureTypeCombo = nullptr; QStackedWidget* appFeatureEditorStack = nullptr; QLineEdit* appFeatureSequenceEdit = nullptr; QLineEdit* appFeatureWebsiteEdit = nullptr; QPushButton* appFeatureSequenceRecordStartButton = nullptr; QPushButton* appFeatureSequenceRecordStopButton = nullptr; QLabel* appPacketTestTransportLabel = nullptr; QLabel* appPacketTestProtocolLabel = nullptr; QLabel* appPacketTestHelloLabel = nullptr; QLabel* appPacketTestAckLabel = nullptr; QLabel* appPacketTestErrorLabel = nullptr; QLabel* appPacketTestBitmapLabel = nullptr; QTableWidget* appPacketTestTable = nullptr; QPlainTextEdit* appPacketTestLogEdit = nullptr; QPushButton* appPacketTestRefreshButton = nullptr; QComboBox* appPacketTestTargetCombo = nullptr; QPushButton* appPacketTestSendHelloButton = nullptr; QPushButton* appPacketTestSendBitmapCurrentButton = nullptr; QPushButton* appPacketTestSendBitmapAllOnButton = nullptr; QPushButton* appPacketTestSendBitmapAllOffButton = nullptr; QPushButton* appPacketTestSendTimeSyncButton = nullptr; QSpinBox* appPacketTestThemeRedSpin = nullptr; QSpinBox* appPacketTestThemeGreenSpin = nullptr; QSpinBox* appPacketTestThemeBlueSpin = nullptr; QPushButton* appPacketTestSendThemeButton = nullptr; QPushButton* appPacketTestClearLogButton = nullptr; bool appIsUpdatingFeatureUi = false; bool appIsSequenceRecording = false; int appSelectedFeatureId = 0; QSet appSequenceRecordingPressedKeySet; QTimer appTimerPoll; QTimer appTimerAutoRefreshDevice; Lgc_Core_Struct_State appLgcState; }; } // namespace APP