diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp new file mode 100644 index 0000000..ecc9730 --- /dev/null +++ b/app/gui/oven_control/config.cpp @@ -0,0 +1,6 @@ +#include "config.h" + +Config::Config(QObject *parent) : QObject(parent) +{ + +} diff --git a/app/gui/oven_control/config.h b/app/gui/oven_control/config.h new file mode 100644 index 0000000..fcaf62f --- /dev/null +++ b/app/gui/oven_control/config.h @@ -0,0 +1,31 @@ +#ifndef CONFIG_H +#define CONFIG_H + + +#include + +namespace Define +{ + enum ConfigType { + + }; +} + +class Config : public QObject +{ + Q_OBJECT + + explicit Config(QObject *parent = 0); + + static Config *instance; + +public: + static Config *getInstance(); + static void init(); + +signals: + +public slots: +}; + +#endif // CONFIG_H diff --git a/app/gui/oven_control/configpanelbutton.cpp b/app/gui/oven_control/configpanelbutton.cpp new file mode 100644 index 0000000..903e787 --- /dev/null +++ b/app/gui/oven_control/configpanelbutton.cpp @@ -0,0 +1,90 @@ +#include "configpanelbutton.h" +#include "ui_configpanelbutton.h" + +#include +#include + +ConfigPanelButton::ConfigPanelButton(QWidget *parent) : + QWidget(parent), + ui(new Ui::ConfigPanelButton) +{ + ui->setupUi(this); + + showingFavoriteButton = false; + ui->favoriteButton->hide(); + + textRect = QRect(20, 0, 556, 65); + valueRect = QRect(556, 0, 265, 65); + connect(ui->pushButton, SIGNAL(pressed()), SIGNAL(pressed())); + connect(ui->pushButton, SIGNAL(released()), SIGNAL(released())); + connect(ui->pushButton, SIGNAL(clicked()), SIGNAL(clicked())); +} + +ConfigPanelButton::~ConfigPanelButton() +{ + delete ui; +} + +void ConfigPanelButton::setText(const QString &text) +{ + if (text_ == text) + return; + + text_ = text; + + updateIcon(); +} + +void ConfigPanelButton::setValue(const QString &value) +{ + if (value_ == value) + return; + + value_ = value; + + updateIcon(); +} + +void ConfigPanelButton::showFavoriteButton() +{ + if (showingFavoriteButton) + return; + + showingFavoriteButton = true; + ui->favoriteButton->show(); + + textRect = QRect(20 + 77, 0, 556 - 77, 65); + updateIcon(); +} + +void ConfigPanelButton::hideFavoriteButton() +{ + if (!showingFavoriteButton) + return; + + showingFavoriteButton = false; + ui->favoriteButton->hide(); + + textRect = QRect(20, 0, 556, 65); + updateIcon(); +} + +void ConfigPanelButton::updateIcon() +{ + QPixmap pixmap(ui->pushButton->size()); + pixmap.fill(Qt::transparent); + + QFont font = ui->pushButton->font(); + font.setPixelSize(30); + + QPainter painter(&pixmap); + painter.setFont(font); + painter.setPen(Qt::white); + painter.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text_); + painter.setPen(Qt::gray); + painter.drawText(valueRect, Qt::AlignCenter, value_); + + QIcon icon(pixmap); + ui->pushButton->setIcon(icon); + ui->pushButton->setIconSize(pixmap.size()); +} diff --git a/app/gui/oven_control/configpanelbutton.h b/app/gui/oven_control/configpanelbutton.h new file mode 100644 index 0000000..0b5f3de --- /dev/null +++ b/app/gui/oven_control/configpanelbutton.h @@ -0,0 +1,48 @@ +#ifndef CONFIGPANELBUTTON_H +#define CONFIGPANELBUTTON_H + +#include + +namespace Ui { +class ConfigPanelButton; +} + +class ConfigPanelButton : public QWidget +{ + Q_OBJECT + +public: + explicit ConfigPanelButton(QWidget *parent = 0); + ~ConfigPanelButton(); + + const QString &text() { return text_; } + const QString &value() { return value_; } + +public slots: + void setText(const QString &text); + void setValue(const QString &value); + void showFavoriteButton(); + void hideFavoriteButton(); + +private: + Ui::ConfigPanelButton *ui; + + QString text_; + QString value_; + + QRect textRect; + QRect valueRect; + + bool showingFavoriteButton; + bool isFavorited; + +private slots: + void updateIcon(); + +signals: + void pressed(); + void released(); + void clicked(); +}; + +#endif // CONFIGPANELBUTTON_H diff --git a/app/gui/oven_control/configpanelbutton.ui b/app/gui/oven_control/configpanelbutton.ui new file mode 100644 index 0000000..b5a209d --- /dev/null +++ b/app/gui/oven_control/configpanelbutton.ui @@ -0,0 +1,100 @@ + + + ConfigPanelButton + + + + 0 + 0 + 821 + 65 + + + + + 821 + 65 + + + + + 821 + 65 + + + + Form + + + QPushButton { +background-position: center; +background-repeat: no-repeat; +border: none; +} + + + + + 0 + 0 + 821 + 65 + + + + + 0 + 0 + + + + + 821 + 65 + + + + + 821 + 65 + + + + + Roboto + 11 + + + + QPushButton { background-image: url(:/images/config/pannel.png); } +QPushButton:pressed { background-image: url(:/images/config/pannel_ov.png); } +QPushButton:focus { background-image: url(:/images/config/pannel_ov.png); } + + + + + + + + + 0 + 0 + 77 + 65 + + + + Qt::NoFocus + + + QPushButton { background-image: url(:/images/config/088_fava_02.png); } +QPushButton:pressed { background-image: url(:/images/config/088_fava_01.png); } + + + + + + + + + diff --git a/app/gui/oven_control/configwindow.cpp b/app/gui/oven_control/configwindow.cpp index f7893f1..90870e0 100644 --- a/app/gui/oven_control/configwindow.cpp +++ b/app/gui/oven_control/configwindow.cpp @@ -11,6 +11,8 @@ ConfigWindow::ConfigWindow(QWidget *parent) : ui->clockContainer->setParent(ui->upperStack); setAttribute(Qt::WA_DeleteOnClose); + + } ConfigWindow::~ConfigWindow() @@ -20,7 +22,10 @@ ConfigWindow::~ConfigWindow() void ConfigWindow::on_pushButton_clicked() { - FunctionTestWindow *w = new FunctionTestWindow(this); - w->setAttribute((Qt::WA_DeleteOnClose)); - w->showFullScreen(); + +} + +void ConfigWindow::on_backButton_clicked() +{ + close(); } diff --git a/app/gui/oven_control/configwindow.h b/app/gui/oven_control/configwindow.h index 1f4794c..1e31be6 100644 --- a/app/gui/oven_control/configwindow.h +++ b/app/gui/oven_control/configwindow.h @@ -20,6 +20,8 @@ public: private slots: void on_pushButton_clicked(); + void on_backButton_clicked(); + private: Ui::ConfigWindow *ui; }; diff --git a/app/gui/oven_control/configwindow.ui b/app/gui/oven_control/configwindow.ui index 5fb72f8..ab8ddf9 100644 --- a/app/gui/oven_control/configwindow.ui +++ b/app/gui/oven_control/configwindow.ui @@ -14,9 +14,20 @@ MainWindow - QWidget#centralwidget { -background-image: url(:/images/images/config/001_01_background_all.png); -} + #centralwidget { background-image: url(:/images/background/config.png); } +#bottomBar { background-image: url(:/images/bottom_bar/background.png); } + +QPushButton[style="type"] { +background-repeat: no-repeat; +background-position: center; +background-origin: margin; + +border-top: 140px; +border-style: hidden; +color: white; +font-size: 30px; +} + @@ -45,26 +56,346 @@ background-image: url(:/images/images/config/001_01_background_all.png); - + - 740 - 710 - 69 - 90 + 0 + 426 + 900 + 421 - - QPushButton { - border-image: url(:/images/images/config/050_setting_btn_08.png); -} -QPushButton:pressed { - border-image: url(:/images/images/config/050_setting_btn_08_ov.png); -} + + + 0 + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_01.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_01_ov.png); } + + + 즐겨찾기 + + + type + + + + + + + + 1 + 171 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_02.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_02_ov.png); } + + + 설정 + + + type + + + + + + + + 1 + 170 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_03.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_03_ov.png); } + + + 음향 관리 + + + type + + + + + + + + 1 + 170 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_04.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_04_ov.png); } + + + 시스템 관리 + + + type + + + + + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_05.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_05_ov.png); } + + + 에너지 관리 + + + type + + + + + + + + 1 + 170 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_06.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_06_ov.png); } + + + 전문가 설정 + + + type + + + + + + + + 1 + 170 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_07.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_07_ov.png); } + + + 화면 관리 + + + type + + + + + + + + 1 + 170 + + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + QPushButton { background-image: url(:/images/config/050_setting_btn_08.png); } +QPushButton:pressed, QPushButton:focus { background-image: url(:/images/config/050_setting_btn_08_ov.png); } + + + 서비스 + + + type + + + + + + + + + + + 16 + 636 + 868 + 1 + + + + + 868 + 16777215 + - - + + Qt::Horizontal + + + + + + 0 + 1450 + 900 + 150 + + + + + 288 + 26 + 97 + 97 + + + + QPushButton { border-image: url(:/images/bottom_bar/back.png); } +QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); } + + + + + + + + + 402 + 26 + 97 + 97 + + + + QPushButton { border-image: url(:/images/bottom_bar/wash.png); } +QPushButton:pressed { border-image: url(:/images/bottom_bar/wash_ov.png); } + + + + + + + + + 515 + 26 + 97 + 97 + + + + QPushButton { border-image: url(:/images/bottom_bar/help.png); } +QPushButton:pressed { border-image: url(:/images/bottom_bar/help_ov.png); } + + + + + diff --git a/app/gui/oven_control/cook.h b/app/gui/oven_control/cook.h index 47b09ee..5abadad 100644 --- a/app/gui/oven_control/cook.h +++ b/app/gui/oven_control/cook.h @@ -5,7 +5,7 @@ struct CookConfig { - Define::ConfigType type; + Define::CookConfigType type; int maximum; int current; }; diff --git a/app/gui/oven_control/define.cpp b/app/gui/oven_control/define.cpp index 5b30b87..cd2b3a4 100644 --- a/app/gui/oven_control/define.cpp +++ b/app/gui/oven_control/define.cpp @@ -1,6 +1,6 @@ #include "define.h" -Define::ConfigType Define::identifyConfigType(QString type) +Define::CookConfigType Define::identifyConfigType(QString type) { if (type == "brightness") return Brightness; @@ -178,7 +178,7 @@ QString Define::icon(Define::CookType type) } } -QString Define::icon(Define::ConfigType type) +QString Define::icon(Define::CookConfigType type) { switch (type) { @@ -213,7 +213,7 @@ QString Define::icon(Define::ConfigType type) } } -QString Define::iconOverlay(Define::ConfigType type) +QString Define::iconOverlay(Define::CookConfigType type) { switch (type) { @@ -248,7 +248,7 @@ QString Define::iconOverlay(Define::ConfigType type) } } -QString Define::minimum(Define::ConfigType type) +QString Define::minimum(Define::CookConfigType type) { switch (type) { @@ -283,7 +283,7 @@ QString Define::minimum(Define::ConfigType type) } } -QString Define::maximum(Define::ConfigType type) +QString Define::maximum(Define::CookConfigType type) { switch (type) { diff --git a/app/gui/oven_control/define.h b/app/gui/oven_control/define.h index a0962b9..b1306a5 100644 --- a/app/gui/oven_control/define.h +++ b/app/gui/oven_control/define.h @@ -19,7 +19,7 @@ namespace Define QString icon(CookType type); - enum ConfigType + enum CookConfigType { InvalidConfig, ConfigNotUsed, @@ -37,11 +37,11 @@ namespace Define Thermometer }; - ConfigType identifyConfigType(QString type); - QString icon(ConfigType type); - QString iconOverlay(ConfigType type); - QString minimum(ConfigType type); - QString maximum(ConfigType type); + CookConfigType identifyConfigType(QString type); + QString icon(CookConfigType type); + QString iconOverlay(CookConfigType type); + QString minimum(CookConfigType type); + QString maximum(CookConfigType type); enum StepClass { diff --git a/app/gui/oven_control/mainwindow.cpp b/app/gui/oven_control/mainwindow.cpp index 6ba8a60..c0723ed 100644 --- a/app/gui/oven_control/mainwindow.cpp +++ b/app/gui/oven_control/mainwindow.cpp @@ -101,10 +101,14 @@ void MainWindow::on_washButton_clicked() void MainWindow::on_configButton_clicked() { - EngineerMenuWindow *w = new EngineerMenuWindow(this); + ConfigWindow *w = new ConfigWindow(this); w->setWindowModality(Qt::WindowModal); w->showFullScreen(); w->raise(); +// EngineerMenuWindow *w = new EngineerMenuWindow(this); +// w->setWindowModality(Qt::WindowModal); +// w->showFullScreen(); +// w->raise(); } void MainWindow::on_helpButton_clicked() diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index b7c4052..d62a218 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -62,7 +62,9 @@ SOURCES += main.cpp\ soundplayer.cpp \ servicedata.cpp \ adjustmentwindow.cpp \ - yesnopopupdlg.cpp + yesnopopupdlg.cpp \ + configpanelbutton.cpp \ + config.cpp HEADERS += mainwindow.h \ cook.h \ @@ -114,7 +116,9 @@ HEADERS += mainwindow.h \ soundplayer.h \ servicedata.h \ adjustmentwindow.h \ - yesnopopupdlg.h + yesnopopupdlg.h \ + configpanelbutton.h \ + config.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -145,7 +149,8 @@ FORMS += mainwindow.ui \ realtimepartswindow.ui \ realtimesensorwindow.ui \ adjustmentwindow.ui \ - yesnopopupdlg.ui + yesnopopupdlg.ui \ + configpanelbutton.ui RESOURCES += \ resources.qrc