From c12e09d9ad83be590d7a1b1e1caa6b30273ca205 Mon Sep 17 00:00:00 2001 From: byloveletter <byloveletter@falinux.com> Date: Fri, 21 Apr 2017 17:17:47 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B5=90=EC=A0=95=20UI=20=EB=B0=8F=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 교정 UI 화면 구현 - Yes, No 선택 팝업 화면 구현(return value) --- app/gui/oven_control/adjustmentwindow.cpp | 15 ++ app/gui/oven_control/adjustmentwindow.h | 3 + app/gui/oven_control/adjustmentwindow.ui | 250 ++++++++++++++++++++- app/gui/oven_control/engineermenuwindow.cpp | 9 + app/gui/oven_control/engineermenuwindow.h | 2 + .../images/config/service/adjustment_line.png | Bin 0 -> 172 bytes app/gui/oven_control/oven_control.pro | 9 +- app/gui/oven_control/resources.qrc | 1 + app/gui/oven_control/yesnopopupdlg.cpp | 32 +++ app/gui/oven_control/yesnopopupdlg.h | 27 +++ app/gui/oven_control/yesnopopupdlg.ui | 136 +++++++++++ 11 files changed, 472 insertions(+), 12 deletions(-) create mode 100644 app/gui/oven_control/images/config/service/adjustment_line.png create mode 100644 app/gui/oven_control/yesnopopupdlg.cpp create mode 100644 app/gui/oven_control/yesnopopupdlg.h create mode 100644 app/gui/oven_control/yesnopopupdlg.ui diff --git a/app/gui/oven_control/adjustmentwindow.cpp b/app/gui/oven_control/adjustmentwindow.cpp index 3df378d..cb87045 100644 --- a/app/gui/oven_control/adjustmentwindow.cpp +++ b/app/gui/oven_control/adjustmentwindow.cpp @@ -1,5 +1,7 @@ +#include <qdebug.h> #include "adjustmentwindow.h" #include "ui_adjustmentwindow.h" +#include "yesnopopupdlg.h" AdjustmentWindow::AdjustmentWindow(QWidget *parent) : QMainWindow(parent), @@ -12,3 +14,16 @@ AdjustmentWindow::~AdjustmentWindow() { delete ui; } + +void AdjustmentWindow::on_btnAdjust_clicked() +{ + YesNoPopupDlg* w = new YesNoPopupDlg(this,tr("모든 설정 값을 공장(출고)초기화\n값으로 변경 하시겠습니까?")); + w->raise(); + int dlgrst = w->exec(); + dlgrst = w->result(); + if(dlgrst == QDialog::Accepted) { + //Process Init Value; + qDebug() << "Accepted"; + } + else qDebug() <<"Rejected"; +} diff --git a/app/gui/oven_control/adjustmentwindow.h b/app/gui/oven_control/adjustmentwindow.h index 1b70686..e704ffa 100644 --- a/app/gui/oven_control/adjustmentwindow.h +++ b/app/gui/oven_control/adjustmentwindow.h @@ -15,6 +15,9 @@ public: explicit AdjustmentWindow(QWidget *parent = 0); ~AdjustmentWindow(); +private slots: + void on_btnAdjust_clicked(); + private: Ui::AdjustmentWindow *ui; }; diff --git a/app/gui/oven_control/adjustmentwindow.ui b/app/gui/oven_control/adjustmentwindow.ui index 0e0d312..76a1fd5 100644 --- a/app/gui/oven_control/adjustmentwindow.ui +++ b/app/gui/oven_control/adjustmentwindow.ui @@ -1,24 +1,256 @@ +<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <author/> - <comment/> - <exportmacro/> <class>AdjustmentWindow</class> <widget class="QMainWindow" name="AdjustmentWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> - <width>800</width> - <height>600</height> + <width>900</width> + <height>1600</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> - <widget class="QMenuBar" name="menubar"/> - <widget class="QWidget" name="centralwidget"/> - <widget class="QStatusBar" name="statusbar"/> + <property name="styleSheet"> + <string notr="true">#centralwidget { background-image: url(:/images/background/config_service.png); } +#bottomBar { background-image: url(:/images/bottom_bar/background.png); }</string> + </property> + <widget class="QWidget" name="centralwidget"> + <property name="styleSheet"> + <string notr="true"/> + </property> + <widget class="QStackedWidget" name="upperStack"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>426</height> + </rect> + </property> + <widget class="QWidget" name="clockContainer"> + <property name="styleSheet"> + <string notr="true">#clockContainer { background-image: url(:/images/clock/background.png); }</string> + </property> + <widget class="Clock" name="clock" native="true"> + <property name="geometry"> + <rect> + <x>272</x> + <y>36</y> + <width>356</width> + <height>355</height> + </rect> + </property> + </widget> + </widget> + <widget class="QWidget" name="page_2"/> + </widget> + <widget class="QLabel" name="label_15"> + <property name="geometry"> + <rect> + <x>55</x> + <y>426</y> + <width>900</width> + <height>84</height> + </rect> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>11</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color: rgb(255, 255, 255);</string> + </property> + <property name="text"> + <string>서비스단계(엔지니어모드) > 교정</string> + </property> + </widget> + <widget class="QWidget" name="bottomBar" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>1450</y> + <width>900</width> + <height>150</height> + </rect> + </property> + <widget class="QPushButton" name="backButton"> + <property name="geometry"> + <rect> + <x>401</x> + <y>26</y> + <width>97</width> + <height>97</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } +QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</string> + </property> + <property name="text"> + <string/> + </property> + </widget> + </widget> + <widget class="QWidget" name="gridLayoutWidget"> + <property name="geometry"> + <rect> + <x>40</x> + <y>545</y> + <width>821</width> + <height>66</height> + </rect> + </property> + <layout class="QGridLayout" name="gridLayout" columnstretch="67,33"> + <property name="spacing"> + <number>0</number> + </property> + <item row="0" column="0" colspan="2"> + <widget class="QPushButton" name="button"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>10</pointsize> + <weight>75</weight> + <bold>true</bold> + <underline>false</underline> + </font> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/config/pannel.png);color: rgb(255, 255, 255); } +QPushButton:pressed { border-image: url(:/images/config/pannel_ov.png); } +QPushButton { text-align: left;} +</string> + </property> + <property name="text"> + <string> 교정</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QLabel" name="label_17"> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="font"> + <font> + <family>Malgun Gothic</family> + <pointsize>11</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="styleSheet"> + <string notr="true">color: rgb(255, 255, 255);</string> + </property> + <property name="text"> + <string>EM-1</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + <property name="margin"> + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + <widget class="QPushButton" name="btnAdjust"> + <property name="geometry"> + <rect> + <x>124</x> + <y>630</y> + <width>379</width> + <height>70</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Roboto</family> + <pointsize>10</pointsize> + <weight>75</weight> + <bold>true</bold> + <underline>false</underline> + </font> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton { border-image: url(:/images/config/service/089_set_window_all.png); } +QPushButton:pressed { border-image: url(:/images/config/service/089_set_window_all_ov.png); } +QPushButton { + text-align: right; + padding-right : 20px; +}</string> + </property> + <property name="text"> + <string>0/ 00:00</string> + </property> + <property name="iconSize"> + <size> + <width>32</width> + <height>32</height> + </size> + </property> + </widget> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>100</x> + <y>606</y> + <width>28</width> + <height>61</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/config/service/adjustment_line.png</pixmap> + </property> + </widget> + <zorder>label</zorder> + <zorder>upperStack</zorder> + <zorder>label_15</zorder> + <zorder>bottomBar</zorder> + <zorder>gridLayoutWidget</zorder> + <zorder>btnAdjust</zorder> + </widget> </widget> - <pixmapfunction/> + <customwidgets> + <customwidget> + <class>Clock</class> + <extends>QWidget</extends> + <header>clock.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources> + <include location="resources.qrc"/> + </resources> <connections/> </ui> diff --git a/app/gui/oven_control/engineermenuwindow.cpp b/app/gui/oven_control/engineermenuwindow.cpp index 845e9cc..671d195 100644 --- a/app/gui/oven_control/engineermenuwindow.cpp +++ b/app/gui/oven_control/engineermenuwindow.cpp @@ -5,6 +5,7 @@ #include "realtimemain.h" #include "functiontestwindow.h" #include "ovenstatics.h" +#include "adjustmentwindow.h" EngineerMenuWindow::EngineerMenuWindow(QWidget *parent) : QMainWindow(parent), @@ -52,3 +53,11 @@ void EngineerMenuWindow::on_functionTestButton_clicked() w->showFullScreen(); w->raise(); } + +void EngineerMenuWindow::on_engAdjustButton_clicked() +{ + AdjustmentWindow *w = new AdjustmentWindow(this); + w->setWindowModality(Qt::WindowModal); + w->showFullScreen(); + w->raise(); +} diff --git a/app/gui/oven_control/engineermenuwindow.h b/app/gui/oven_control/engineermenuwindow.h index 1f208bb..71073c8 100644 --- a/app/gui/oven_control/engineermenuwindow.h +++ b/app/gui/oven_control/engineermenuwindow.h @@ -24,6 +24,8 @@ private slots: void on_functionTestButton_clicked(); + void on_engAdjustButton_clicked(); + private: Ui::EngineerMenuWindow *ui; }; diff --git a/app/gui/oven_control/images/config/service/adjustment_line.png b/app/gui/oven_control/images/config/service/adjustment_line.png new file mode 100644 index 0000000000000000000000000000000000000000..2c4758dfab89d14f5dad4b1e082b7319891dde0d GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^GC*v}!3HE%bG!wC6kC$Fy9>jA5L~c#`DCC7XMsm# zF#`j)FbFd;%$g$s6l5>)^mS!_$Rf(hXX;zvu?8q)>FMGa5^?zLO-5b@1%|^Ln(NOW zKPo)woCB*)?(9VK#|;h&0vs$%jmXqLrg>ktSM)CA$hgQI&I>ez!PC{xWt~$(6961} BER_HN literal 0 HcmV?d00001 diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index 11fb72d..b7c4052 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -61,7 +61,8 @@ SOURCES += main.cpp\ bulletindicator.cpp \ soundplayer.cpp \ servicedata.cpp \ - adjustmentwindow.cpp + adjustmentwindow.cpp \ + yesnopopupdlg.cpp HEADERS += mainwindow.h \ cook.h \ @@ -112,7 +113,8 @@ HEADERS += mainwindow.h \ bulletindicator.h \ soundplayer.h \ servicedata.h \ - adjustmentwindow.h + adjustmentwindow.h \ + yesnopopupdlg.h FORMS += mainwindow.ui \ manualcookwindow.ui \ @@ -142,7 +144,8 @@ FORMS += mainwindow.ui \ realtimemain.ui \ realtimepartswindow.ui \ realtimesensorwindow.ui \ - adjustmentwindow.ui + adjustmentwindow.ui \ + yesnopopupdlg.ui RESOURCES += \ resources.qrc diff --git a/app/gui/oven_control/resources.qrc b/app/gui/oven_control/resources.qrc index 85ff0f3..5d8a35f 100644 --- a/app/gui/oven_control/resources.qrc +++ b/app/gui/oven_control/resources.qrc @@ -431,5 +431,6 @@ <file>images/config/service/realtime_menu_line.png</file> <file>images/config/service/realtime_parts_bgnd.png</file> <file>images/config/service/realtime_sensor_bgnd.png</file> + <file>images/config/service/adjustment_line.png</file> </qresource> </RCC> diff --git a/app/gui/oven_control/yesnopopupdlg.cpp b/app/gui/oven_control/yesnopopupdlg.cpp new file mode 100644 index 0000000..05ea5a6 --- /dev/null +++ b/app/gui/oven_control/yesnopopupdlg.cpp @@ -0,0 +1,32 @@ +#include "yesnopopupdlg.h" +#include "ui_yesnopopupdlg.h" + +YesNoPopupDlg::YesNoPopupDlg(QWidget *parent, QString strDesc) : + QDialog(parent), + ui(new Ui::YesNoPopupDlg) +{ + ui->setupUi(this); + this->setAttribute( Qt::WA_TranslucentBackground); + this->setAttribute( Qt::WA_DeleteOnClose); + this->setWindowFlags(Qt::FramelessWindowHint); + + ui->ctrLbDesc->setText(strDesc); + +} + +YesNoPopupDlg::~YesNoPopupDlg() +{ + delete ui; +} + +void YesNoPopupDlg::on_ctrBtnYes_clicked() +{ + this->accept(); + +} + +void YesNoPopupDlg::on_ctrBtnNo_clicked() +{ + this->reject(); + +} diff --git a/app/gui/oven_control/yesnopopupdlg.h b/app/gui/oven_control/yesnopopupdlg.h new file mode 100644 index 0000000..ce92bfc --- /dev/null +++ b/app/gui/oven_control/yesnopopupdlg.h @@ -0,0 +1,27 @@ +#ifndef YESNOPOPUPDLG_H +#define YESNOPOPUPDLG_H + +#include <QDialog> + +namespace Ui { +class YesNoPopupDlg; +} + +class YesNoPopupDlg : public QDialog +{ + Q_OBJECT + +public: + explicit YesNoPopupDlg(QWidget *parent = 0, QString strDesc=""); + ~YesNoPopupDlg(); + +private slots: + void on_ctrBtnYes_clicked(); + + void on_ctrBtnNo_clicked(); + +private: + Ui::YesNoPopupDlg *ui; +}; + +#endif // YESNOPOPUPDLG_H diff --git a/app/gui/oven_control/yesnopopupdlg.ui b/app/gui/oven_control/yesnopopupdlg.ui new file mode 100644 index 0000000..09a7038 --- /dev/null +++ b/app/gui/oven_control/yesnopopupdlg.ui @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>YesNoPopupDlg</class> + <widget class="QDialog" name="YesNoPopupDlg"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>503</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <property name="styleSheet"> + <string notr="true">#centralWidget { background-image: url(:/images/background/popup/503.png); +}</string> + </property> + <widget class="QWidget" name="centralWidget" native="true"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>900</width> + <height>503</height> + </rect> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <widget class="QPushButton" name="ctrBtnYes"> + <property name="geometry"> + <rect> + <x>422</x> + <y>362</y> + <width>128</width> + <height>70</height> + </rect> + </property> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + <underline>true</underline> + </font> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ +border : none; +color : white; +} +QPushButton::pressed {color : yellow}</string> + </property> + <property name="text"> + <string>예</string> + </property> + </widget> + <widget class="QPushButton" name="ctrBtnNo"> + <property name="geometry"> + <rect> + <x>572</x> + <y>362</y> + <width>128</width> + <height>70</height> + </rect> + </property> + <property name="font"> + <font> + <weight>75</weight> + <bold>true</bold> + <underline>true</underline> + </font> + </property> + <property name="styleSheet"> + <string notr="true">QPushButton{ +border : none; +color : white; +} +QPushButton::pressed {color : yellow}</string> + </property> + <property name="text"> + <string>아니오</string> + </property> + </widget> + <widget class="QLabel" name="label"> + <property name="geometry"> + <rect> + <x>415</x> + <y>99</y> + <width>61</width> + <height>51</height> + </rect> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="resources.qrc">:/images/symbol/warning.png</pixmap> + </property> + </widget> + <widget class="QLabel" name="ctrLbDesc"> + <property name="geometry"> + <rect> + <x>0</x> + <y>150</y> + <width>900</width> + <height>201</height> + </rect> + </property> + <property name="font"> + <font> + <family>나눔고딕</family> + <pointsize>14</pointsize> + </font> + </property> + <property name="styleSheet"> + <string notr="true">QLabel { + color : white; + border : none; +}</string> + </property> + <property name="text"> + <string>TextLabel</string> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </widget> + </widget> + <resources> + <include location="resources.qrc"/> + </resources> + <connections/> +</ui> -- 2.1.4