configwindow.h 2.22 KB
#ifndef CONFIGWINDOW_H
#define CONFIGWINDOW_H

#include <QMainWindow>
#include <QVector>

#include "udphandler.h"
#include "configpanelbutton.h"
#include "configfavoritebutton.h"
#include "config.h"

using namespace Define;

enum CONFIG_MENU_POS{
    config_menu_favorite = -1,
    config_menu_setting =0,
    config_menu_sound,
    config_menu_system,
    config_menu_energy,
    config_menu_expert,
    config_menu_display,
    config_menu_service
};

namespace Ui {
class ConfigWindow;
}

class ConfigWindow : public QMainWindow
{
    Q_OBJECT

private:
    const uint16_t m_arrMaxMenuCount[7] ={
        5,8,7,2,1,0,5
    };
   const Define::ConfigType m_arrConfigListInfos[7][20] = {
       {config_datetime, config_temptype,config_backlight, config_time_type,config_resttime_format,},
       {config_marster_vol,config_keypad_sound1,config_keypad_sound2,config_request_loadexec,config_programstep_finish,config_cooktime_finish,config_stoperror_distinguish,config_sound_factory_reset},
       {config_info_data_download,config_service_data_download,config_program_download,config_program_upload ,config_ip,config_set_download,config_set_upload},
       {config_set_half_energy,config_set_auto_darkness,},
       {config_duty_wash,},
       {config_invalid,},
       {config_software_info,config_hotline_chef,config_hotline_service,config_steam_wash,config_enter_engineer_mode}
   };
   void reloadUi(void);
   void reloadValue(void);

public:
    explicit ConfigWindow(QWidget *parent = 0);
    ~ConfigWindow();

private slots:
    void on_pushButton_clicked();

    void on_backButton_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_8_clicked();


    void on_pushButton_7_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_washButton_clicked();

    void on_helpButton_clicked();

public slots:
    void onConfigBtnClicked(uint16_t id);
    void onConfigCheckBtnClicked(uint16_t id, bool checked);
    void onDeleteFavoriteBtnClicked(uint16_t id);

private:
    Ui::ConfigWindow *ui;
    QVector<ConfigPanelButton *> m_vectorMenuList;
    QVector<ConfigFavoriteButton*> m_vectorFavorMenuList;
    CONFIG_MENU_POS m_nCurConfigPos;
};

#endif // CONFIGWINDOW_H