#pragma once
#ifndef ORIGINALWND_H
#define ORIGINALWND_H

#include <QMainWindow>
#include "OriginalWnd/DbTreeViewManager.h"
#include <QVBoxLayout>
#include <QJsonObject>
#include <QMessageBox>
#include <QDialog>
#include <QRadioButton>
#include <QButtonGroup>
#include <QLabel>
#include "gen_interface.h"
QT_BEGIN_NAMESPACE
namespace Ui { class OriginalWnd; }
QT_END_NAMESPACE

class OriginalWnd : public QMainWindow
{
    Q_OBJECT

public:
    explicit OriginalWnd(QWidget *parent = nullptr);
    ~OriginalWnd();
    QWidget* getWidgetLeft() const; // 访问 widget 的接口

    // 切换不同配置

    void switchToHomeConfig();
    void switchToProductionConfig();
    void switchToDiagnosisConfig();
    void switchToDispositionConfig();
    void switchToModuleConfig();
    void switchToProgramConfig();
    void switchToSystemConfig();
    void setChineseMode(QMainWindow *OriginalWnd);

    // 当前使用的配置 ID
    int currentConfigId() const { return m_currentConfigId; }


public slots:
    void onHandleLanguageSignal(const int &data);
protected:
    bool eventFilter(QObject *obj,QEvent *event);

private slots:
    void on_ChartButton_clicked();
    void on_DoubleImageButton_clicked();
    void on_SingleImageButton_clicked();

    void updateTime();

    void on_startButton_clicked();

    void on_stopButton_clicked();

private:
    Ui::OriginalWnd *ui;
    DbTreeViewManager* dbTreeViewManager; // 声明为指针
    int m_currentConfigId; // 记录当前配置Id，如 1=Home

    void initForm(); // 初始化表单控件
    Gen_Interface gen_if;
};


#endif // ORIGINALWND_H
