Commit 0e279295fda7fa6d3b3eb7bd3dd8acb686782c6c

Authored by 김태훈
1 parent f72eb28cfb
Exists in master and in 2 other branches fhd, fhd-demo

수동 요리 구현

- 요리 예약
- 요리 반복
app/gui/oven_control/manualcookwindow.cpp
... ... @@ -14,6 +14,8 @@
14 14 #include "stringer.h"
15 15 #include "config.h"
16 16 #include "coretempsettingpopup.h"
  17 +#include "reservetimepopup.h"
  18 +#include "reservedtimepopup.h"
17 19  
18 20 #include <QTime>
19 21  
... ... @@ -505,26 +507,15 @@ void ManualCookWindow::on_cooldownButton_clicked()
505 507  
506 508 void ManualCookWindow::on_reserveButton_clicked()
507 509 {
508   -// if (isReserved)
509   -// {
510   -// isReserved = false;
511   -// ui->reserveButton->setStyleSheet("\
512   -//QPushButton { background-image: url(:/images/manual_button/reserve.png); }\
513   -//QPushButton:pressed { background-image: url(:/images/manual_button/reserve_ov.png); }");
514   -// }
515   -// else
516   -// {
517   -// isReserved = true;
518   -// ui->reserveButton->setStyleSheet("\
519   -//QPushButton { background-image: url(:/images/manual_button/reserve_ov.png); }\
520   -//QPushButton:pressed { background-image: url(:/images/manual_button/reserve.png); }");
521   -// reserved.mode = oven->mode();
522   -// reserved.humidity = oven->humidity();
523   -// reserved.temp= oven->temp();
524   -// reserved.time = oven->time();
525   -// reserved.coreTempEnabled = oven->interTempEnabled();
526   -// reserved.coreTemp = oven->interTemp();
527   -// }
  510 + if (oven->time() > 0)
  511 + {
  512 + startCookingTimer.stop();
  513 +
  514 + ReserveTimePopup *p = new ReserveTimePopup(this);
  515 + connect(p, SIGNAL(timeout()), SLOT(start()));
  516 + connect(p, SIGNAL(canceled()), &startCookingTimer, SLOT(start()));
  517 + p->showFullScreen();
  518 + }
528 519 }
529 520  
530 521 void ManualCookWindow::on_favoriteButton_clicked()
... ...
app/gui/oven_control/oven_control.pro
... ... @@ -113,7 +113,9 @@ SOURCES += main.cpp\
113 113 cookprogram.cpp \
114 114 programmingautoselectionwindow.cpp \
115 115 programmingautoconfigwindow.cpp \
116   - programmingnamepopup.cpp
  116 + programmingnamepopup.cpp \
  117 + reservetimepopup.cpp \
  118 + reservedtimepopup.cpp
117 119  
118 120 HEADERS += mainwindow.h \
119 121 cook.h \
... ... @@ -216,7 +218,9 @@ HEADERS += mainwindow.h \
216 218 cookprogram.h \
217 219 programmingautoselectionwindow.h \
218 220 programmingautoconfigwindow.h \
219   - programmingnamepopup.h
  221 + programmingnamepopup.h \
  222 + reservetimepopup.h \
  223 + reservedtimepopup.h
220 224  
221 225 FORMS += mainwindow.ui \
222 226 manualcookwindow.ui \
... ... @@ -286,7 +290,9 @@ FORMS += mainwindow.ui \
286 290 programmingmanualcoretemppopup.ui \
287 291 programmingautoselectionwindow.ui \
288 292 programmingautoconfigwindow.ui \
289   - programmingnamepopup.ui
  293 + programmingnamepopup.ui \
  294 + reservetimepopup.ui \
  295 + reservedtimepopup.ui
290 296  
291 297 RESOURCES += \
292 298 resources.qrc
... ...
app/gui/oven_control/reservedtimepopup.cpp
... ... @@ -0,0 +1,44 @@
  1 +#include "reservedtimepopup.h"
  2 +#include "ui_reservedtimepopup.h"
  3 +
  4 +#include <QDebug>
  5 +
  6 +#include "stringer.h"
  7 +
  8 +ReservedTimePopup::ReservedTimePopup(QWidget *parent, QDateTime target) :
  9 + QWidget(parent),
  10 + ui(new Ui::ReservedTimePopup),
  11 + target(target)
  12 +{
  13 + ui->setupUi(this);
  14 +
  15 + setAttribute(Qt::WA_DeleteOnClose);
  16 +
  17 + connect(&checkTimeTimer, SIGNAL(timeout()), SLOT(checkTime()));
  18 + checkTimeTimer.start(100);
  19 +
  20 + checkTime();
  21 +}
  22 +
  23 +ReservedTimePopup::~ReservedTimePopup()
  24 +{
  25 + delete ui;
  26 +}
  27 +
  28 +void ReservedTimePopup::checkTime()
  29 +{
  30 + qint64 remaining = QDateTime::currentDateTime().msecsTo(target);
  31 + if (remaining > 0)
  32 + ui->timeLabel->setText(Stringer::remainingTime(remaining));
  33 + else
  34 + {
  35 + emit timeout();
  36 + close();
  37 + }
  38 +}
  39 +
  40 +void ReservedTimePopup::on_cancelButton_clicked()
  41 +{
  42 + emit canceled();
  43 + close();
  44 +}
... ...
app/gui/oven_control/reservedtimepopup.h
... ... @@ -0,0 +1,34 @@
  1 +#ifndef RESERVEDTIMEPOPUP_H
  2 +#define RESERVEDTIMEPOPUP_H
  3 +
  4 +#include <QWidget>
  5 +#include <QTimer>
  6 +#include <QDateTime>
  7 +
  8 +namespace Ui {
  9 +class ReservedTimePopup;
  10 +}
  11 +
  12 +class ReservedTimePopup : public QWidget
  13 +{
  14 + Q_OBJECT
  15 +
  16 +public:
  17 + explicit ReservedTimePopup(QWidget *parent, QDateTime target);
  18 + ~ReservedTimePopup();
  19 +
  20 +private:
  21 + Ui::ReservedTimePopup *ui;
  22 + QDateTime target;
  23 + QTimer checkTimeTimer;
  24 +
  25 +private slots:
  26 + void checkTime();
  27 + void on_cancelButton_clicked();
  28 +
  29 +signals:
  30 + void timeout();
  31 + void canceled();
  32 +};
  33 +
  34 +#endif // RESERVEDTIMEPOPUP_H
... ...
app/gui/oven_control/reservedtimepopup.ui
... ... @@ -0,0 +1,130 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<ui version="4.0">
  3 + <class>ReservedTimePopup</class>
  4 + <widget class="QWidget" name="ReservedTimePopup">
  5 + <property name="geometry">
  6 + <rect>
  7 + <x>0</x>
  8 + <y>0</y>
  9 + <width>900</width>
  10 + <height>1600</height>
  11 + </rect>
  12 + </property>
  13 + <property name="windowTitle">
  14 + <string>Form</string>
  15 + </property>
  16 + <property name="styleSheet">
  17 + <string notr="true">#background { background-image: url(:/images/background/popup/503.png); }
  18 +QLabel, QPushButton, QLineEdit { color: white; }
  19 +QLineEdit { background : transparent; border: none; }
  20 +QPushButton { border: none; }
  21 +QPushButton:pressed { color: yellow; }
  22 +QSpinBox{
  23 + background-color : transparent;
  24 + color : white;
  25 +}</string>
  26 + </property>
  27 + <widget class="QWidget" name="background" native="true">
  28 + <property name="geometry">
  29 + <rect>
  30 + <x>0</x>
  31 + <y>426</y>
  32 + <width>900</width>
  33 + <height>424</height>
  34 + </rect>
  35 + </property>
  36 + <widget class="Line" name="line">
  37 + <property name="geometry">
  38 + <rect>
  39 + <x>0</x>
  40 + <y>95</y>
  41 + <width>900</width>
  42 + <height>3</height>
  43 + </rect>
  44 + </property>
  45 + <property name="styleSheet">
  46 + <string notr="true">color: rgb(255, 255, 255);</string>
  47 + </property>
  48 + <property name="orientation">
  49 + <enum>Qt::Horizontal</enum>
  50 + </property>
  51 + </widget>
  52 + <widget class="QLabel" name="titleLabel">
  53 + <property name="geometry">
  54 + <rect>
  55 + <x>0</x>
  56 + <y>0</y>
  57 + <width>900</width>
  58 + <height>95</height>
  59 + </rect>
  60 + </property>
  61 + <property name="font">
  62 + <font>
  63 + <pointsize>14</pointsize>
  64 + </font>
  65 + </property>
  66 + <property name="text">
  67 + <string>예약 시간</string>
  68 + </property>
  69 + <property name="alignment">
  70 + <set>Qt::AlignCenter</set>
  71 + </property>
  72 + </widget>
  73 + <widget class="QLabel" name="timeLabel">
  74 + <property name="geometry">
  75 + <rect>
  76 + <x>0</x>
  77 + <y>100</y>
  78 + <width>900</width>
  79 + <height>199</height>
  80 + </rect>
  81 + </property>
  82 + <property name="font">
  83 + <font>
  84 + <family>나눔고딕</family>
  85 + <pointsize>18</pointsize>
  86 + <weight>75</weight>
  87 + <bold>true</bold>
  88 + </font>
  89 + </property>
  90 + <property name="text">
  91 + <string>0</string>
  92 + </property>
  93 + <property name="alignment">
  94 + <set>Qt::AlignCenter</set>
  95 + </property>
  96 + </widget>
  97 + <widget class="QPushButton" name="cancelButton">
  98 + <property name="geometry">
  99 + <rect>
  100 + <x>649</x>
  101 + <y>321</y>
  102 + <width>181</width>
  103 + <height>99</height>
  104 + </rect>
  105 + </property>
  106 + <property name="sizePolicy">
  107 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  108 + <horstretch>0</horstretch>
  109 + <verstretch>0</verstretch>
  110 + </sizepolicy>
  111 + </property>
  112 + <property name="font">
  113 + <font>
  114 + <family>나눔고딕</family>
  115 + <pointsize>12</pointsize>
  116 + <underline>true</underline>
  117 + </font>
  118 + </property>
  119 + <property name="text">
  120 + <string>취소</string>
  121 + </property>
  122 + <property name="flat">
  123 + <bool>true</bool>
  124 + </property>
  125 + </widget>
  126 + </widget>
  127 + </widget>
  128 + <resources/>
  129 + <connections/>
  130 +</ui>
... ...
app/gui/oven_control/reservetimepopup.cpp
... ... @@ -0,0 +1,51 @@
  1 +#include "reservetimepopup.h"
  2 +#include "ui_reservetimepopup.h"
  3 +
  4 +#include <QDateTime>
  5 +
  6 +#include "reservedtimepopup.h"
  7 +
  8 +ReserveTimePopup::ReserveTimePopup(QWidget *parent) :
  9 + QWidget(parent),
  10 + ui(new Ui::ReserveTimePopup)
  11 +{
  12 + ui->setupUi(this);
  13 +
  14 + setAttribute(Qt::WA_DeleteOnClose);
  15 +
  16 + QDateTime dt = QDateTime::currentDateTime();
  17 + ui->month->setValue(dt.date().month());
  18 + ui->day->setValue(dt.date().day());
  19 + ui->hour->setValue(dt.time().hour());
  20 + ui->min->setValue(dt.time().minute());
  21 +}
  22 +
  23 +ReserveTimePopup::~ReserveTimePopup()
  24 +{
  25 + delete ui;
  26 +}
  27 +
  28 +void ReserveTimePopup::on_okButton_clicked()
  29 +{
  30 + QDateTime current = QDateTime::currentDateTime();
  31 + QDateTime target;
  32 + target.setDate(QDate(current.date().year(), ui->month->value(), ui->day->value()));
  33 + target.setTime(QTime(ui->hour->value(), ui->min->value()));
  34 +
  35 + if (current >= target)
  36 + target = target.addYears(1);
  37 +
  38 + ReservedTimePopup *p = new ReservedTimePopup(parentWidget(), target);
  39 + connect(p, SIGNAL(timeout()), SIGNAL(timeout()));
  40 + connect(p, SIGNAL(canceled()), SIGNAL(canceled()));
  41 + connect(p, SIGNAL(destroyed(QObject*)), SLOT(deleteLater()));
  42 + p->showFullScreen();
  43 +
  44 + hide();
  45 +}
  46 +
  47 +void ReserveTimePopup::on_cancelButton_clicked()
  48 +{
  49 + emit canceled();
  50 + close();
  51 +}
... ...
app/gui/oven_control/reservetimepopup.h
... ... @@ -0,0 +1,31 @@
  1 +#ifndef RESERVETIMEPOPUP_H
  2 +#define RESERVETIMEPOPUP_H
  3 +
  4 +#include <QWidget>
  5 +
  6 +namespace Ui {
  7 +class ReserveTimePopup;
  8 +}
  9 +
  10 +class ReserveTimePopup : public QWidget
  11 +{
  12 + Q_OBJECT
  13 +
  14 +public:
  15 + explicit ReserveTimePopup(QWidget *parent = 0);
  16 + ~ReserveTimePopup();
  17 +
  18 +private slots:
  19 + void on_okButton_clicked();
  20 +
  21 + void on_cancelButton_clicked();
  22 +
  23 +private:
  24 + Ui::ReserveTimePopup *ui;
  25 +
  26 +signals:
  27 + void timeout();
  28 + void canceled();
  29 +};
  30 +
  31 +#endif // RESERVETIMEPOPUP_H
... ...
app/gui/oven_control/reservetimepopup.ui
... ... @@ -0,0 +1,434 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<ui version="4.0">
  3 + <class>ReserveTimePopup</class>
  4 + <widget class="QWidget" name="ReserveTimePopup">
  5 + <property name="geometry">
  6 + <rect>
  7 + <x>0</x>
  8 + <y>0</y>
  9 + <width>900</width>
  10 + <height>1600</height>
  11 + </rect>
  12 + </property>
  13 + <property name="windowTitle">
  14 + <string>Form</string>
  15 + </property>
  16 + <property name="styleSheet">
  17 + <string notr="true">#background { background-image: url(:/images/background/popup/503.png); }
  18 +QLabel, QPushButton, QLineEdit { color: white; }
  19 +QLineEdit { background : transparent; border: none; }
  20 +QPushButton { border: none; }
  21 +QPushButton:pressed { color: yellow; }
  22 +QSpinBox{
  23 + background-color : transparent;
  24 + color : white;
  25 +}</string>
  26 + </property>
  27 + <widget class="QWidget" name="background" native="true">
  28 + <property name="geometry">
  29 + <rect>
  30 + <x>0</x>
  31 + <y>426</y>
  32 + <width>900</width>
  33 + <height>1024</height>
  34 + </rect>
  35 + </property>
  36 + <widget class="Line" name="line">
  37 + <property name="geometry">
  38 + <rect>
  39 + <x>0</x>
  40 + <y>95</y>
  41 + <width>900</width>
  42 + <height>3</height>
  43 + </rect>
  44 + </property>
  45 + <property name="styleSheet">
  46 + <string notr="true">color: rgb(255, 255, 255);</string>
  47 + </property>
  48 + <property name="orientation">
  49 + <enum>Qt::Horizontal</enum>
  50 + </property>
  51 + </widget>
  52 + <widget class="QWidget" name="horizontalLayoutWidget">
  53 + <property name="geometry">
  54 + <rect>
  55 + <x>460</x>
  56 + <y>320</y>
  57 + <width>371</width>
  58 + <height>101</height>
  59 + </rect>
  60 + </property>
  61 + <layout class="QHBoxLayout" name="horizontalLayout">
  62 + <item>
  63 + <widget class="QPushButton" name="okButton">
  64 + <property name="sizePolicy">
  65 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  66 + <horstretch>0</horstretch>
  67 + <verstretch>0</verstretch>
  68 + </sizepolicy>
  69 + </property>
  70 + <property name="font">
  71 + <font>
  72 + <family>나눔고딕</family>
  73 + <pointsize>12</pointsize>
  74 + <underline>true</underline>
  75 + </font>
  76 + </property>
  77 + <property name="text">
  78 + <string>확인</string>
  79 + </property>
  80 + <property name="flat">
  81 + <bool>true</bool>
  82 + </property>
  83 + </widget>
  84 + </item>
  85 + <item>
  86 + <widget class="QPushButton" name="cancelButton">
  87 + <property name="sizePolicy">
  88 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  89 + <horstretch>0</horstretch>
  90 + <verstretch>0</verstretch>
  91 + </sizepolicy>
  92 + </property>
  93 + <property name="font">
  94 + <font>
  95 + <family>나눔고딕</family>
  96 + <pointsize>12</pointsize>
  97 + <underline>true</underline>
  98 + </font>
  99 + </property>
  100 + <property name="text">
  101 + <string>취소</string>
  102 + </property>
  103 + <property name="flat">
  104 + <bool>true</bool>
  105 + </property>
  106 + </widget>
  107 + </item>
  108 + </layout>
  109 + </widget>
  110 + <widget class="QLabel" name="titleLabel">
  111 + <property name="geometry">
  112 + <rect>
  113 + <x>0</x>
  114 + <y>0</y>
  115 + <width>900</width>
  116 + <height>95</height>
  117 + </rect>
  118 + </property>
  119 + <property name="font">
  120 + <font>
  121 + <pointsize>14</pointsize>
  122 + </font>
  123 + </property>
  124 + <property name="text">
  125 + <string>예약 시간 설정</string>
  126 + </property>
  127 + <property name="alignment">
  128 + <set>Qt::AlignCenter</set>
  129 + </property>
  130 + </widget>
  131 + <widget class="QLabel" name="label_4">
  132 + <property name="geometry">
  133 + <rect>
  134 + <x>246</x>
  135 + <y>100</y>
  136 + <width>44</width>
  137 + <height>199</height>
  138 + </rect>
  139 + </property>
  140 + <property name="font">
  141 + <font>
  142 + <family>나눔고딕</family>
  143 + <pointsize>18</pointsize>
  144 + <weight>75</weight>
  145 + <bold>true</bold>
  146 + </font>
  147 + </property>
  148 + <property name="text">
  149 + <string>월</string>
  150 + </property>
  151 + </widget>
  152 + <widget class="QLabel" name="label_5">
  153 + <property name="geometry">
  154 + <rect>
  155 + <x>575</x>
  156 + <y>100</y>
  157 + <width>44</width>
  158 + <height>199</height>
  159 + </rect>
  160 + </property>
  161 + <property name="font">
  162 + <font>
  163 + <family>나눔고딕</family>
  164 + <pointsize>18</pointsize>
  165 + <weight>75</weight>
  166 + <bold>true</bold>
  167 + </font>
  168 + </property>
  169 + <property name="text">
  170 + <string>시</string>
  171 + </property>
  172 + </widget>
  173 + <widget class="QLabel" name="label_6">
  174 + <property name="geometry">
  175 + <rect>
  176 + <x>739</x>
  177 + <y>100</y>
  178 + <width>44</width>
  179 + <height>199</height>
  180 + </rect>
  181 + </property>
  182 + <property name="font">
  183 + <font>
  184 + <family>나눔고딕</family>
  185 + <pointsize>18</pointsize>
  186 + <weight>75</weight>
  187 + <bold>true</bold>
  188 + </font>
  189 + </property>
  190 + <property name="text">
  191 + <string>분</string>
  192 + </property>
  193 + </widget>
  194 + <widget class="FormatterSpinBox" name="month">
  195 + <property name="geometry">
  196 + <rect>
  197 + <x>141</x>
  198 + <y>100</y>
  199 + <width>90</width>
  200 + <height>199</height>
  201 + </rect>
  202 + </property>
  203 + <property name="sizePolicy">
  204 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  205 + <horstretch>0</horstretch>
  206 + <verstretch>0</verstretch>
  207 + </sizepolicy>
  208 + </property>
  209 + <property name="font">
  210 + <font>
  211 + <family>나눔고딕</family>
  212 + <pointsize>18</pointsize>
  213 + <underline>true</underline>
  214 + </font>
  215 + </property>
  216 + <property name="focusPolicy">
  217 + <enum>Qt::StrongFocus</enum>
  218 + </property>
  219 + <property name="frame">
  220 + <bool>false</bool>
  221 + </property>
  222 + <property name="alignment">
  223 + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
  224 + </property>
  225 + <property name="buttonSymbols">
  226 + <enum>QAbstractSpinBox::NoButtons</enum>
  227 + </property>
  228 + <property name="minimum">
  229 + <number>1</number>
  230 + </property>
  231 + <property name="maximum">
  232 + <number>12</number>
  233 + </property>
  234 + <property name="value">
  235 + <number>12</number>
  236 + </property>
  237 + </widget>
  238 + <widget class="QLabel" name="label_3">
  239 + <property name="geometry">
  240 + <rect>
  241 + <x>410</x>
  242 + <y>100</y>
  243 + <width>45</width>
  244 + <height>199</height>
  245 + </rect>
  246 + </property>
  247 + <property name="font">
  248 + <font>
  249 + <family>나눔고딕</family>
  250 + <pointsize>18</pointsize>
  251 + <weight>75</weight>
  252 + <bold>true</bold>
  253 + </font>
  254 + </property>
  255 + <property name="text">
  256 + <string>일</string>
  257 + </property>
  258 + </widget>
  259 + <widget class="FormatterSpinBox" name="min">
  260 + <property name="geometry">
  261 + <rect>
  262 + <x>634</x>
  263 + <y>100</y>
  264 + <width>90</width>
  265 + <height>199</height>
  266 + </rect>
  267 + </property>
  268 + <property name="sizePolicy">
  269 + <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
  270 + <horstretch>0</horstretch>
  271 + <verstretch>0</verstretch>
  272 + </sizepolicy>
  273 + </property>
  274 + <property name="minimumSize">
  275 + <size>
  276 + <width>86</width>
  277 + <height>0</height>
  278 + </size>
  279 + </property>
  280 + <property name="font">
  281 + <font>
  282 + <family>나눔고딕</family>
  283 + <pointsize>18</pointsize>
  284 + <underline>true</underline>
  285 + <kerning>true</kerning>
  286 + </font>
  287 + </property>
  288 + <property name="mouseTracking">
  289 + <bool>false</bool>
  290 + </property>
  291 + <property name="focusPolicy">
  292 + <enum>Qt::StrongFocus</enum>
  293 + </property>
  294 + <property name="frame">
  295 + <bool>false</bool>
  296 + </property>
  297 + <property name="alignment">
  298 + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
  299 + </property>
  300 + <property name="buttonSymbols">
  301 + <enum>QAbstractSpinBox::NoButtons</enum>
  302 + </property>
  303 + <property name="suffix">
  304 + <string notr="true"/>
  305 + </property>
  306 + <property name="prefix">
  307 + <string notr="true"/>
  308 + </property>
  309 + <property name="minimum">
  310 + <number>0</number>
  311 + </property>
  312 + <property name="maximum">
  313 + <number>60</number>
  314 + </property>
  315 + <property name="value">
  316 + <number>20</number>
  317 + </property>
  318 + </widget>
  319 + <widget class="FormatterSpinBox" name="day">
  320 + <property name="geometry">
  321 + <rect>
  322 + <x>305</x>
  323 + <y>100</y>
  324 + <width>90</width>
  325 + <height>199</height>
  326 + </rect>
  327 + </property>
  328 + <property name="sizePolicy">
  329 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  330 + <horstretch>0</horstretch>
  331 + <verstretch>0</verstretch>
  332 + </sizepolicy>
  333 + </property>
  334 + <property name="font">
  335 + <font>
  336 + <family>나눔고딕</family>
  337 + <pointsize>18</pointsize>
  338 + <underline>true</underline>
  339 + </font>
  340 + </property>
  341 + <property name="focusPolicy">
  342 + <enum>Qt::StrongFocus</enum>
  343 + </property>
  344 + <property name="frame">
  345 + <bool>false</bool>
  346 + </property>
  347 + <property name="alignment">
  348 + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
  349 + </property>
  350 + <property name="buttonSymbols">
  351 + <enum>QAbstractSpinBox::NoButtons</enum>
  352 + </property>
  353 + <property name="minimum">
  354 + <number>1</number>
  355 + </property>
  356 + <property name="maximum">
  357 + <number>31</number>
  358 + </property>
  359 + <property name="value">
  360 + <number>20</number>
  361 + </property>
  362 + </widget>
  363 + <widget class="FormatterSpinBox" name="hour">
  364 + <property name="geometry">
  365 + <rect>
  366 + <x>470</x>
  367 + <y>100</y>
  368 + <width>90</width>
  369 + <height>199</height>
  370 + </rect>
  371 + </property>
  372 + <property name="sizePolicy">
  373 + <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
  374 + <horstretch>0</horstretch>
  375 + <verstretch>0</verstretch>
  376 + </sizepolicy>
  377 + </property>
  378 + <property name="font">
  379 + <font>
  380 + <family>나눔고딕</family>
  381 + <pointsize>18</pointsize>
  382 + <underline>true</underline>
  383 + </font>
  384 + </property>
  385 + <property name="focusPolicy">
  386 + <enum>Qt::StrongFocus</enum>
  387 + </property>
  388 + <property name="frame">
  389 + <bool>false</bool>
  390 + </property>
  391 + <property name="alignment">
  392 + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
  393 + </property>
  394 + <property name="buttonSymbols">
  395 + <enum>QAbstractSpinBox::NoButtons</enum>
  396 + </property>
  397 + <property name="minimum">
  398 + <number>0</number>
  399 + </property>
  400 + <property name="maximum">
  401 + <number>23</number>
  402 + </property>
  403 + <property name="value">
  404 + <number>20</number>
  405 + </property>
  406 + </widget>
  407 + </widget>
  408 + <widget class="KeyboardWidget" name="keyboard" native="true">
  409 + <property name="geometry">
  410 + <rect>
  411 + <x>0</x>
  412 + <y>850</y>
  413 + <width>900</width>
  414 + <height>600</height>
  415 + </rect>
  416 + </property>
  417 + </widget>
  418 + </widget>
  419 + <customwidgets>
  420 + <customwidget>
  421 + <class>KeyboardWidget</class>
  422 + <extends>QWidget</extends>
  423 + <header>keyboardwidget.h</header>
  424 + <container>1</container>
  425 + </customwidget>
  426 + <customwidget>
  427 + <class>FormatterSpinBox</class>
  428 + <extends>QSpinBox</extends>
  429 + <header>formatterspinbox.h</header>
  430 + </customwidget>
  431 + </customwidgets>
  432 + <resources/>
  433 + <connections/>
  434 +</ui>
... ...
app/gui/oven_control/stringer.cpp
... ... @@ -118,6 +118,32 @@ QString Stringer::remainingTime(int msecs, QString style)
118 118 return QString();
119 119 }
120 120  
  121 +QString Stringer::remainingTime(qint64 msecs)
  122 +{
  123 + switch (::remainingTime())
  124 + {
  125 + case RemainingTime:
  126 + msecs /= 1000;
  127 + if (msecs >= 3600)
  128 + return QString("%1시간 %2분").arg(msecs / 3600).arg((msecs % 3600) / 60, 2, 10, QLatin1Char('0'));
  129 + if (msecs >= 60)
  130 + return QString("%1분 %2초").arg(msecs / 60).arg(msecs % 60, 2, 10, QLatin1Char('0'));
  131 +
  132 + return QString("%1초").arg(msecs);
  133 + case FinishTime:
  134 + QDateTime dateTime = QDateTime::currentDateTime().addMSecs(msecs);
  135 + switch (realTimeFormat())
  136 + {
  137 + case Hour12:
  138 + return dateTime.toString("A hh:mm:ss");
  139 + case Hour24:
  140 + return dateTime.toString("HH:mm:ss");
  141 + }
  142 + }
  143 +
  144 + return QString();
  145 +}
  146 +
121 147 QString Stringer::temperature(int celsius)
122 148 {
123 149 switch (temperatureFormat())
... ...
app/gui/oven_control/stringer.h
... ... @@ -20,8 +20,9 @@ span.light { font-size: 11pt; }\
20 20 span.lightest { font-size: 9pt; }\
21 21 </style>");
22 22  
23   -QString remainingTime(int secs);
24   -QString remainingTime(int secs, QString style);
  23 +QString remainingTime(int msecs);
  24 +QString remainingTime(int msecs, QString style);
  25 +QString remainingTime(qint64 msecs);
25 26 QString temperature(int celsius);
26 27 QString temperature(int celsius, QString style);
27 28 QString temperature(int current, int target);
... ...