Commit 6e338d03f2e8536ab763af945b6ed75cd4c817c8
1 parent
8fabace654
Exists in
master
and in
2 other branches
연소가스동작 추가
Showing
7 changed files
with
889 additions
and
36 deletions
Show diff stats
app/gui/oven_control/functiontestwindow.cpp
... | ... | @@ -25,6 +25,8 @@ FunctionTestWindow::FunctionTestWindow(QWidget *parent) : |
25 | 25 | ui->clockContainer->setParent(ui->upperStack); |
26 | 26 | setAttribute(Qt::WA_DeleteOnClose); |
27 | 27 | |
28 | + ui->gasTestContainer->hide(); | |
29 | + | |
28 | 30 | foreach (QPushButton *button, findChildren<QPushButton *>()) |
29 | 31 | connect(button, &QPushButton::pressed, SoundPlayer::playClick); |
30 | 32 | |
... | ... | @@ -103,8 +105,25 @@ void FunctionTestWindow::on_fanTestButton_clicked() |
103 | 105 | |
104 | 106 | void FunctionTestWindow::on_gasTestButton_clicked() |
105 | 107 | { |
106 | -// GasTestWindow *w = new GasTestWindow(this, udp); | |
107 | - // w->showFullScreen(); | |
108 | + ui->gasTestContainer->show(); | |
109 | +} | |
110 | + | |
111 | +void FunctionTestWindow::on_upperGasTestButton_clicked() | |
112 | +{ | |
113 | + GasTestWindow *w = new GasTestWindow(GasTestWindow::Upper, this); | |
114 | + w->showFullScreen(); | |
115 | +} | |
116 | + | |
117 | +void FunctionTestWindow::on_lowerGasTestButton_clicked() | |
118 | +{ | |
119 | + GasTestWindow *w = new GasTestWindow(GasTestWindow::Lower, this); | |
120 | + w->showFullScreen(); | |
121 | +} | |
122 | + | |
123 | +void FunctionTestWindow::on_steamGasTestButton_clicked() | |
124 | +{ | |
125 | + GasTestWindow *w = new GasTestWindow(GasTestWindow::Steam, this); | |
126 | + w->showFullScreen(); | |
108 | 127 | } |
109 | 128 | |
110 | 129 | void FunctionTestWindow::onEncoderLeft() | ... | ... |
app/gui/oven_control/functiontestwindow.h
... | ... | @@ -33,6 +33,12 @@ private slots: |
33 | 33 | |
34 | 34 | void on_gasTestButton_clicked(); |
35 | 35 | |
36 | + void on_upperGasTestButton_clicked(); | |
37 | + | |
38 | + void on_lowerGasTestButton_clicked(); | |
39 | + | |
40 | + void on_steamGasTestButton_clicked(); | |
41 | + | |
36 | 42 | void on_adjustBlowerFan_clicked(); |
37 | 43 | |
38 | 44 | private: | ... | ... |
app/gui/oven_control/functiontestwindow.ui
... | ... | @@ -107,7 +107,7 @@ |
107 | 107 | <property name="geometry"> |
108 | 108 | <rect> |
109 | 109 | <x>127</x> |
110 | - <y>616</y> | |
110 | + <y>600</y> | |
111 | 111 | <width>379</width> |
112 | 112 | <height>70</height> |
113 | 113 | </rect> |
... | ... | @@ -138,7 +138,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
138 | 138 | <property name="geometry"> |
139 | 139 | <rect> |
140 | 140 | <x>127</x> |
141 | - <y>710</y> | |
141 | + <y>680</y> | |
142 | 142 | <width>379</width> |
143 | 143 | <height>70</height> |
144 | 144 | </rect> |
... | ... | @@ -169,7 +169,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
169 | 169 | <property name="geometry"> |
170 | 170 | <rect> |
171 | 171 | <x>127</x> |
172 | - <y>804</y> | |
172 | + <y>760</y> | |
173 | 173 | <width>379</width> |
174 | 174 | <height>70</height> |
175 | 175 | </rect> |
... | ... | @@ -200,7 +200,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
200 | 200 | <property name="geometry"> |
201 | 201 | <rect> |
202 | 202 | <x>127</x> |
203 | - <y>898</y> | |
203 | + <y>842</y> | |
204 | 204 | <width>379</width> |
205 | 205 | <height>70</height> |
206 | 206 | </rect> |
... | ... | @@ -231,7 +231,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
231 | 231 | <property name="geometry"> |
232 | 232 | <rect> |
233 | 233 | <x>127</x> |
234 | - <y>992</y> | |
234 | + <y>927</y> | |
235 | 235 | <width>379</width> |
236 | 236 | <height>70</height> |
237 | 237 | </rect> |
... | ... | @@ -262,7 +262,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
262 | 262 | <property name="geometry"> |
263 | 263 | <rect> |
264 | 264 | <x>127</x> |
265 | - <y>1086</y> | |
265 | + <y>1090</y> | |
266 | 266 | <width>379</width> |
267 | 267 | <height>70</height> |
268 | 268 | </rect> |
... | ... | @@ -501,7 +501,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
501 | 501 | <property name="geometry"> |
502 | 502 | <rect> |
503 | 503 | <x>100</x> |
504 | - <y>651</y> | |
504 | + <y>635</y> | |
505 | 505 | <width>30</width> |
506 | 506 | <height>1</height> |
507 | 507 | </rect> |
... | ... | @@ -514,9 +514,9 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
514 | 514 | <property name="geometry"> |
515 | 515 | <rect> |
516 | 516 | <x>79</x> |
517 | - <y>580</y> | |
517 | + <y>571</y> | |
518 | 518 | <width>41</width> |
519 | - <height>631</height> | |
519 | + <height>554</height> | |
520 | 520 | </rect> |
521 | 521 | </property> |
522 | 522 | <property name="orientation"> |
... | ... | @@ -527,7 +527,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
527 | 527 | <property name="geometry"> |
528 | 528 | <rect> |
529 | 529 | <x>100</x> |
530 | - <y>745</y> | |
530 | + <y>715</y> | |
531 | 531 | <width>30</width> |
532 | 532 | <height>1</height> |
533 | 533 | </rect> |
... | ... | @@ -540,7 +540,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
540 | 540 | <property name="geometry"> |
541 | 541 | <rect> |
542 | 542 | <x>100</x> |
543 | - <y>839</y> | |
543 | + <y>795</y> | |
544 | 544 | <width>30</width> |
545 | 545 | <height>1</height> |
546 | 546 | </rect> |
... | ... | @@ -553,7 +553,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
553 | 553 | <property name="geometry"> |
554 | 554 | <rect> |
555 | 555 | <x>100</x> |
556 | - <y>933</y> | |
556 | + <y>877</y> | |
557 | 557 | <width>30</width> |
558 | 558 | <height>1</height> |
559 | 559 | </rect> |
... | ... | @@ -566,7 +566,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
566 | 566 | <property name="geometry"> |
567 | 567 | <rect> |
568 | 568 | <x>100</x> |
569 | - <y>1027</y> | |
569 | + <y>962</y> | |
570 | 570 | <width>30</width> |
571 | 571 | <height>1</height> |
572 | 572 | </rect> |
... | ... | @@ -579,7 +579,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
579 | 579 | <property name="geometry"> |
580 | 580 | <rect> |
581 | 581 | <x>100</x> |
582 | - <y>1121</y> | |
582 | + <y>1045</y> | |
583 | 583 | <width>30</width> |
584 | 584 | <height>1</height> |
585 | 585 | </rect> |
... | ... | @@ -592,7 +592,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
592 | 592 | <property name="geometry"> |
593 | 593 | <rect> |
594 | 594 | <x>100</x> |
595 | - <y>1209</y> | |
595 | + <y>1124</y> | |
596 | 596 | <width>30</width> |
597 | 597 | <height>1</height> |
598 | 598 | </rect> |
... | ... | @@ -605,7 +605,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b |
605 | 605 | <property name="geometry"> |
606 | 606 | <rect> |
607 | 607 | <x>128</x> |
608 | - <y>1175</y> | |
608 | + <y>1010</y> | |
609 | 609 | <width>379</width> |
610 | 610 | <height>70</height> |
611 | 611 | </rect> |
... | ... | @@ -632,8 +632,164 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_o |
632 | 632 | <string>송풍기 교정</string> |
633 | 633 | </property> |
634 | 634 | </widget> |
635 | - <zorder>line</zorder> | |
635 | + <widget class="QWidget" name="gasTestContainer" native="true"> | |
636 | + <property name="geometry"> | |
637 | + <rect> | |
638 | + <x>90</x> | |
639 | + <y>1150</y> | |
640 | + <width>521</width> | |
641 | + <height>261</height> | |
642 | + </rect> | |
643 | + </property> | |
644 | + <widget class="Line" name="line_9"> | |
645 | + <property name="geometry"> | |
646 | + <rect> | |
647 | + <x>70</x> | |
648 | + <y>0</y> | |
649 | + <width>41</width> | |
650 | + <height>224</height> | |
651 | + </rect> | |
652 | + </property> | |
653 | + <property name="orientation"> | |
654 | + <enum>Qt::Vertical</enum> | |
655 | + </property> | |
656 | + </widget> | |
657 | + <widget class="QPushButton" name="steamGasTestButton"> | |
658 | + <property name="geometry"> | |
659 | + <rect> | |
660 | + <x>118</x> | |
661 | + <y>189</y> | |
662 | + <width>379</width> | |
663 | + <height>70</height> | |
664 | + </rect> | |
665 | + </property> | |
666 | + <property name="sizePolicy"> | |
667 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
668 | + <horstretch>0</horstretch> | |
669 | + <verstretch>0</verstretch> | |
670 | + </sizepolicy> | |
671 | + </property> | |
672 | + <property name="font"> | |
673 | + <font> | |
674 | + <family>NanumGothic</family> | |
675 | + <pointsize>10</pointsize> | |
676 | + <weight>75</weight> | |
677 | + <bold>true</bold> | |
678 | + </font> | |
679 | + </property> | |
680 | + <property name="styleSheet"> | |
681 | + <string notr="true">QPushButton { border-image: url(:/images/button/379.png); } | |
682 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_ov.png); }</string> | |
683 | + </property> | |
684 | + <property name="text"> | |
685 | + <string>스팀용송풍기</string> | |
686 | + </property> | |
687 | + </widget> | |
688 | + <widget class="QPushButton" name="lowerGasTestButton"> | |
689 | + <property name="geometry"> | |
690 | + <rect> | |
691 | + <x>119</x> | |
692 | + <y>109</y> | |
693 | + <width>379</width> | |
694 | + <height>70</height> | |
695 | + </rect> | |
696 | + </property> | |
697 | + <property name="sizePolicy"> | |
698 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
699 | + <horstretch>0</horstretch> | |
700 | + <verstretch>0</verstretch> | |
701 | + </sizepolicy> | |
702 | + </property> | |
703 | + <property name="font"> | |
704 | + <font> | |
705 | + <family>NanumGothic</family> | |
706 | + <pointsize>10</pointsize> | |
707 | + <weight>75</weight> | |
708 | + <bold>true</bold> | |
709 | + </font> | |
710 | + </property> | |
711 | + <property name="styleSheet"> | |
712 | + <string notr="true">QPushButton { border-image: url(:/images/button/379.png); } | |
713 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_ov.png); }</string> | |
714 | + </property> | |
715 | + <property name="text"> | |
716 | + <string>건열부송풍기(하)</string> | |
717 | + </property> | |
718 | + </widget> | |
719 | + <widget class="QPushButton" name="upperGasTestButton"> | |
720 | + <property name="geometry"> | |
721 | + <rect> | |
722 | + <x>118</x> | |
723 | + <y>26</y> | |
724 | + <width>379</width> | |
725 | + <height>70</height> | |
726 | + </rect> | |
727 | + </property> | |
728 | + <property name="sizePolicy"> | |
729 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
730 | + <horstretch>0</horstretch> | |
731 | + <verstretch>0</verstretch> | |
732 | + </sizepolicy> | |
733 | + </property> | |
734 | + <property name="font"> | |
735 | + <font> | |
736 | + <family>NanumGothic</family> | |
737 | + <pointsize>10</pointsize> | |
738 | + <weight>75</weight> | |
739 | + <bold>true</bold> | |
740 | + </font> | |
741 | + </property> | |
742 | + <property name="styleSheet"> | |
743 | + <string notr="true">QPushButton { border-image: url(:/images/button/379.png); } | |
744 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/379_ov.png); }</string> | |
745 | + </property> | |
746 | + <property name="text"> | |
747 | + <string>건열부송풍기(상)</string> | |
748 | + </property> | |
749 | + </widget> | |
750 | + <widget class="Line" name="line_10"> | |
751 | + <property name="geometry"> | |
752 | + <rect> | |
753 | + <x>91</x> | |
754 | + <y>144</y> | |
755 | + <width>30</width> | |
756 | + <height>1</height> | |
757 | + </rect> | |
758 | + </property> | |
759 | + <property name="orientation"> | |
760 | + <enum>Qt::Horizontal</enum> | |
761 | + </property> | |
762 | + </widget> | |
763 | + <widget class="Line" name="line_11"> | |
764 | + <property name="geometry"> | |
765 | + <rect> | |
766 | + <x>91</x> | |
767 | + <y>223</y> | |
768 | + <width>30</width> | |
769 | + <height>1</height> | |
770 | + </rect> | |
771 | + </property> | |
772 | + <property name="orientation"> | |
773 | + <enum>Qt::Horizontal</enum> | |
774 | + </property> | |
775 | + </widget> | |
776 | + <widget class="Line" name="line_12"> | |
777 | + <property name="geometry"> | |
778 | + <rect> | |
779 | + <x>91</x> | |
780 | + <y>61</y> | |
781 | + <width>30</width> | |
782 | + <height>1</height> | |
783 | + </rect> | |
784 | + </property> | |
785 | + <property name="orientation"> | |
786 | + <enum>Qt::Horizontal</enum> | |
787 | + </property> | |
788 | + </widget> | |
789 | + </widget> | |
790 | + <zorder>gasTestContainer</zorder> | |
636 | 791 | <zorder>line_2</zorder> |
792 | + <zorder>line</zorder> | |
637 | 793 | <zorder>upperStack</zorder> |
638 | 794 | <zorder>widget</zorder> |
639 | 795 | <zorder>burnerTestButton</zorder> | ... | ... |
app/gui/oven_control/gastestwindow.cpp
... | ... | @@ -2,26 +2,48 @@ |
2 | 2 | #include "ui_gastestwindow.h" |
3 | 3 | |
4 | 4 | #include <QKeyEvent> |
5 | +#include <QDebug> | |
5 | 6 | |
6 | 7 | #include "soundplayer.h" |
8 | +#include "config.h" | |
7 | 9 | |
8 | -GasTestWindow::GasTestWindow(QWidget *parent, UdpHandler *udp) : | |
10 | +GasTestWindow::GasTestWindow(Target target, QWidget *parent) : | |
9 | 11 | QMainWindow(parent), |
10 | - ui(new Ui::GasTestWindow), udp(udp) | |
12 | + ui(new Ui::GasTestWindow), target(target) | |
11 | 13 | { |
12 | 14 | ui->setupUi(this); |
13 | 15 | |
14 | 16 | ui->clockContainer->setParent(ui->upperStack); |
15 | 17 | setAttribute(Qt::WA_DeleteOnClose); |
16 | 18 | |
17 | - foreach (QPushButton *button, findChildren<QPushButton *>()) | |
18 | - connect(button, &QPushButton::pressed, SoundPlayer::playClick); | |
19 | + switch (target) | |
20 | + { | |
21 | + case Upper: | |
22 | + ui->titleLabel->setText(tr("서비스단계(엔지니어모드) > 기능테스트 > 연소가스동작 > 건열송풍기(상)")); | |
23 | + break; | |
24 | + case Lower: | |
25 | + ui->titleLabel->setText(tr("서비스단계(엔지니어모드) > 기능테스트 > 연소가스동작 > 건열송풍기(하)")); | |
26 | + break; | |
27 | + case Steam: | |
28 | + ui->titleLabel->setText(tr("서비스단계(엔지니어모드) > 기능테스트 > 연소가스동작 > 스팀용송풍기")); | |
29 | + break; | |
30 | + } | |
19 | 31 | |
32 | + udp = UdpHandler::getInstance(); | |
33 | + udp->set(TG_OVEN_MODE, 4); | |
20 | 34 | connect(udp, SIGNAL(changed()), this, SLOT(onDataChanged())); |
35 | + | |
36 | + stopTimer.setInterval(60 * 1000); | |
37 | + connect(&stopTimer, SIGNAL(timeout()), SLOT(stop())); | |
38 | + | |
39 | + foreach (QPushButton *button, findChildren<QPushButton *>()) | |
40 | + connect(button, &QPushButton::pressed, SoundPlayer::playClick); | |
21 | 41 | } |
22 | 42 | |
23 | 43 | GasTestWindow::~GasTestWindow() |
24 | 44 | { |
45 | + stop(); | |
46 | + | |
25 | 47 | delete ui; |
26 | 48 | } |
27 | 49 | |
... | ... | @@ -60,9 +82,264 @@ void GasTestWindow::keyReleaseEvent(QKeyEvent *event) |
60 | 82 | } |
61 | 83 | } |
62 | 84 | |
85 | +void GasTestWindow::updateView() | |
86 | +{ | |
87 | + ui->rpmLabel->setText(QString("%1 rpm").arg(currentRpm())); | |
88 | + | |
89 | + switch (phase) | |
90 | + { | |
91 | + case Min: | |
92 | + ui->minButton->setText(isRunning() ? "STOP" : "START"); | |
93 | + ui->maxButton->setText("START"); | |
94 | + break; | |
95 | + case Max: | |
96 | + ui->minButton->setText("START"); | |
97 | + ui->maxButton->setText(isRunning() ? "STOP" : "START"); | |
98 | + break; | |
99 | + default: | |
100 | + ui->minButton->setText("START"); | |
101 | + ui->maxButton->setText("START"); | |
102 | + } | |
103 | +} | |
104 | + | |
63 | 105 | void GasTestWindow::onDataChanged() |
64 | 106 | { |
107 | + switch (phase) | |
108 | + { | |
109 | + case MinStopping: | |
110 | + case MaxStopping: | |
111 | + if (!isRunning()) | |
112 | + phase = Idle; | |
113 | + default: | |
114 | + break; | |
115 | + } | |
116 | + | |
117 | + updateView(); | |
118 | +} | |
119 | + | |
120 | +void GasTestWindow::startMin() | |
121 | +{ | |
122 | + switch (target) | |
123 | + { | |
124 | + case Upper: | |
125 | + runUpper(minRpm()); | |
126 | + break; | |
127 | + case Lower: | |
128 | + runLower(minRpm()); | |
129 | + break; | |
130 | + case Steam: | |
131 | + runSteam(minRpm()); | |
132 | + break; | |
133 | + } | |
134 | + | |
135 | + stopTimer.start(); | |
136 | + | |
137 | + phase = Min; | |
138 | +} | |
139 | + | |
140 | +void GasTestWindow::startMax() | |
141 | +{ | |
142 | + switch (target) | |
143 | + { | |
144 | + case Upper: | |
145 | + runUpper(maxRpm()); | |
146 | + break; | |
147 | + case Lower: | |
148 | + runLower(maxRpm()); | |
149 | + break; | |
150 | + case Steam: | |
151 | + runSteam(maxRpm()); | |
152 | + break; | |
153 | + } | |
154 | + | |
155 | + stopTimer.start(); | |
156 | + | |
157 | + phase = Max; | |
158 | +} | |
159 | + | |
160 | +void GasTestWindow::stop() | |
161 | +{ | |
162 | + if (stopTimer.isActive()) | |
163 | + stopTimer.stop(); | |
164 | + | |
165 | + switch (target) | |
166 | + { | |
167 | + case Upper: | |
168 | + stopUpper(); | |
169 | + break; | |
170 | + case Lower: | |
171 | + stopLower(); | |
172 | + break; | |
173 | + case Steam: | |
174 | + stopSteam(); | |
175 | + break; | |
176 | + } | |
65 | 177 | |
178 | + switch (phase) | |
179 | + { | |
180 | + case Min: | |
181 | + phase = MinStopping; | |
182 | + break; | |
183 | + case Max: | |
184 | + phase = MaxStopping; | |
185 | + break; | |
186 | + default: | |
187 | + break; | |
188 | + } | |
189 | +} | |
190 | + | |
191 | +void GasTestWindow::runUpper(int rpm) | |
192 | +{ | |
193 | + udp->set(TG_BUNNER1_RPM, rpm); | |
194 | + udp->turnOn(TG_BUNNER1_MANUAL); | |
195 | + udp->turnOn(TG_BUNNER1_FAN); | |
196 | + udp->turnOn(TG_MANUAL_BURNER1); | |
197 | + | |
198 | + udp->set(TG_FAN1_DIRECTOIN, 0); | |
199 | + udp->set(TG_FAN1_RPM, 1175); | |
200 | + udp->turnOn(TG_FAN1_MANUAL); | |
201 | + udp->turnOn(TG_MANUAL_FAN1); | |
202 | +} | |
203 | + | |
204 | +void GasTestWindow::runLower(int rpm) | |
205 | +{ | |
206 | + udp->set(TG_BUNNER2_RPM, rpm); | |
207 | + udp->turnOn(TG_BUNNER2_MANUAL); | |
208 | + udp->turnOn(TG_BUNNER2_FAN); | |
209 | + udp->turnOn(TG_MANUAL_BURNER2); | |
210 | + | |
211 | + udp->set(TG_FAN2_DIRECTOIN, 0); | |
212 | + udp->set(TG_FAN2_RPM, 1175); | |
213 | + udp->turnOn(TG_FAN2_MANUAL); | |
214 | + udp->turnOn(TG_MANUAL_FAN2); | |
215 | +} | |
216 | + | |
217 | +void GasTestWindow::runSteam(int rpm) | |
218 | +{ | |
219 | + udp->set(TG_BUNNER3_RPM, rpm); | |
220 | + udp->turnOn(TG_BUNNER3_MANUAL); | |
221 | + udp->turnOn(TG_BUNNER3_FAN); | |
222 | + udp->turnOn(TG_MANUAL_BURNER3); | |
223 | +} | |
224 | + | |
225 | +void GasTestWindow::stopUpper() | |
226 | +{ | |
227 | + udp->turnOff(TG_MANUAL_BURNER1); | |
228 | + udp->turnOff(TG_BUNNER1_MANUAL); | |
229 | + udp->turnOff(TG_BUNNER1_FAN); | |
230 | + | |
231 | + udp->turnOff(TG_MANUAL_FAN1); | |
232 | + udp->turnOff(TG_FAN1_MANUAL); | |
233 | +} | |
234 | + | |
235 | +void GasTestWindow::stopLower() | |
236 | +{ | |
237 | + udp->turnOff(TG_MANUAL_BURNER2); | |
238 | + udp->turnOff(TG_BUNNER2_MANUAL); | |
239 | + udp->turnOff(TG_BUNNER2_FAN); | |
240 | + | |
241 | + udp->turnOff(TG_MANUAL_FAN2); | |
242 | + udp->turnOff(TG_FAN2_MANUAL); | |
243 | +} | |
244 | + | |
245 | +void GasTestWindow::stopSteam() | |
246 | +{ | |
247 | + udp->turnOff(TG_MANUAL_BURNER3); | |
248 | + udp->turnOff(TG_BUNNER3_MANUAL); | |
249 | + udp->turnOff(TG_BUNNER3_FAN); | |
250 | +} | |
251 | + | |
252 | +int GasTestWindow::minRpm() | |
253 | +{ | |
254 | + Config *config = Config::getInstance(); | |
255 | + | |
256 | + switch (target) | |
257 | + { | |
258 | + case Upper: | |
259 | + case Lower: | |
260 | + if (isHalf()) | |
261 | + return config->getConfigValue(Define::config_burner23_pwr1_half_rpm).d32; | |
262 | + else | |
263 | + return config->getConfigValue(Define::config_burner23_pwr1_normal_rpm).d32; | |
264 | + case Steam: | |
265 | + default: | |
266 | + if (isHalf()) | |
267 | + return config->getConfigValue(Define::config_burner1_pwr1_half_rpm).d32; | |
268 | + else | |
269 | + return config->getConfigValue(Define::config_burner1_pwr1_normal_rpm).d32; | |
270 | + } | |
271 | +} | |
272 | + | |
273 | +int GasTestWindow::maxRpm() | |
274 | +{ | |
275 | + Config *config = Config::getInstance(); | |
276 | + | |
277 | + switch (target) | |
278 | + { | |
279 | + case Upper: | |
280 | + case Lower: | |
281 | + if (isHalf()) | |
282 | + return config->getConfigValue(Define::config_burner23_pwr2_half_rpm).d32; | |
283 | + else | |
284 | + return config->getConfigValue(Define::config_burner23_pwr2_normal_rpm).d32; | |
285 | + case Steam: | |
286 | + default: | |
287 | + if (isHalf()) | |
288 | + return config->getConfigValue(Define::config_burner1_pwr2_half_rpm).d32; | |
289 | + else | |
290 | + return config->getConfigValue(Define::config_burner1_pwr2_normal_rpm).d32; | |
291 | + } | |
292 | +} | |
293 | + | |
294 | +bool GasTestWindow::isHalf() | |
295 | +{ | |
296 | + return Config::getInstance()->getConfigValue(Define::config_set_half_energy).d32 > 0; | |
297 | +} | |
298 | + | |
299 | +bool GasTestWindow::isRunning() | |
300 | +{ | |
301 | + switch (target) | |
302 | + { | |
303 | + case Upper: | |
304 | + return udp->burner1() || udp->burnerFan1(); | |
305 | + case Lower: | |
306 | + return udp->burner2() || udp->burnerFan2(); | |
307 | + case Steam: | |
308 | + return udp->burner3() || udp->burnerFan3(); | |
309 | + default: | |
310 | + return false; | |
311 | + } | |
312 | +} | |
313 | + | |
314 | +int GasTestWindow::currentRpm() | |
315 | +{ | |
316 | + switch (target) | |
317 | + { | |
318 | + case Upper: | |
319 | + return udp->getData().burner1_current_rpm; | |
320 | + case Lower: | |
321 | + return udp->getData().burner2_current_rpm; | |
322 | + case Steam: | |
323 | + return udp->getData().burner3_current_rpm; | |
324 | + default: | |
325 | + return 0; | |
326 | + } | |
327 | +} | |
328 | + | |
329 | +void GasTestWindow::on_minButton_clicked() | |
330 | +{ | |
331 | + if (isRunning() && (phase == Min || phase == MinStopping)) | |
332 | + stop(); | |
333 | + else | |
334 | + startMin(); | |
335 | +} | |
336 | + | |
337 | +void GasTestWindow::on_maxButton_clicked() | |
338 | +{ | |
339 | + if (isRunning() && (phase == Max || phase == MaxStopping)) | |
340 | + stop(); | |
341 | + else | |
342 | + startMax(); | |
66 | 343 | } |
67 | 344 | |
68 | 345 | void GasTestWindow::on_backButton_clicked() | ... | ... |
app/gui/oven_control/gastestwindow.h
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | #define GASTESTWINDOW_H |
3 | 3 | |
4 | 4 | #include <QMainWindow> |
5 | +#include <QTimer> | |
5 | 6 | |
6 | 7 | #include "udphandler.h" |
7 | 8 | |
... | ... | @@ -14,7 +15,17 @@ class GasTestWindow : public QMainWindow |
14 | 15 | Q_OBJECT |
15 | 16 | |
16 | 17 | public: |
17 | - explicit GasTestWindow(QWidget *parent = 0, UdpHandler *udp = 0); | |
18 | + enum Target { | |
19 | + Upper, Lower, Steam | |
20 | + }; | |
21 | + | |
22 | + enum Phase { | |
23 | + Idle, | |
24 | + Min, MinStopping, | |
25 | + Max, MaxStopping | |
26 | + }; | |
27 | + | |
28 | + explicit GasTestWindow(Target target, QWidget *parent = 0); | |
18 | 29 | ~GasTestWindow(); |
19 | 30 | |
20 | 31 | protected: |
... | ... | @@ -22,13 +33,37 @@ protected: |
22 | 33 | void keyReleaseEvent(QKeyEvent *event); |
23 | 34 | |
24 | 35 | private slots: |
36 | + void updateView(); | |
25 | 37 | void onDataChanged(); |
38 | + void startMin(); | |
39 | + void startMax(); | |
40 | + void stop(); | |
41 | + | |
42 | + void runUpper(int rpm); | |
43 | + void runLower(int rpm); | |
44 | + void runSteam(int rpm); | |
45 | + void stopUpper(); | |
46 | + void stopLower(); | |
47 | + void stopSteam(); | |
26 | 48 | |
49 | + int minRpm(); | |
50 | + int maxRpm(); | |
51 | + | |
52 | + bool isHalf(); | |
53 | + bool isRunning(); | |
54 | + int currentRpm(); | |
55 | + | |
56 | + void on_minButton_clicked(); | |
57 | + void on_maxButton_clicked(); | |
27 | 58 | void on_backButton_clicked(); |
28 | 59 | |
60 | + | |
29 | 61 | private: |
30 | 62 | Ui::GasTestWindow *ui; |
31 | 63 | UdpHandler *udp; |
64 | + Target target; | |
65 | + Phase phase = Idle; | |
66 | + QTimer stopTimer; | |
32 | 67 | |
33 | 68 | QWidget *pushed = NULL; |
34 | 69 | ... | ... |
app/gui/oven_control/gastestwindow.ui
... | ... | @@ -110,18 +110,18 @@ |
110 | 110 | </property> |
111 | 111 | <property name="styleSheet"> |
112 | 112 | <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/back.png); } |
113 | -QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</string> | |
113 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/back_ov.png); }</string> | |
114 | 114 | </property> |
115 | 115 | <property name="text"> |
116 | 116 | <string/> |
117 | 117 | </property> |
118 | 118 | </widget> |
119 | 119 | </widget> |
120 | - <widget class="QPushButton" name="pushButton_4"> | |
120 | + <widget class="QPushButton" name="minButton"> | |
121 | 121 | <property name="geometry"> |
122 | 122 | <rect> |
123 | - <x>580</x> | |
124 | - <y>640</y> | |
123 | + <x>697</x> | |
124 | + <y>890</y> | |
125 | 125 | <width>184</width> |
126 | 126 | <height>70</height> |
127 | 127 | </rect> |
... | ... | @@ -134,23 +134,379 @@ QPushButton:pressed { border-image: url(:/images/bottom_bar/back_ov.png); }</str |
134 | 134 | </property> |
135 | 135 | <property name="font"> |
136 | 136 | <font> |
137 | + <family>Roboto</family> | |
138 | + <pointsize>10</pointsize> | |
137 | 139 | <weight>75</weight> |
138 | 140 | <bold>true</bold> |
139 | 141 | </font> |
140 | 142 | </property> |
141 | 143 | <property name="styleSheet"> |
142 | - <string notr="true">QPushButton { | |
143 | - border-image: url(:/images/images/config_service/090_set_eng_btn_03.png); | |
144 | -} | |
145 | - | |
146 | -QPushButton:pressed { | |
147 | - border-image: url(:/images/images/config_service/090_set_eng_btn_03_ov.png); | |
148 | -}</string> | |
144 | + <string notr="true">QPushButton { border-image: url(:/images/button/184.png); } | |
145 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/184_ov.png); }</string> | |
149 | 146 | </property> |
150 | 147 | <property name="text"> |
151 | 148 | <string>START</string> |
152 | 149 | </property> |
153 | 150 | </widget> |
151 | + <widget class="QLabel" name="label_9"> | |
152 | + <property name="geometry"> | |
153 | + <rect> | |
154 | + <x>55</x> | |
155 | + <y>550</y> | |
156 | + <width>231</width> | |
157 | + <height>70</height> | |
158 | + </rect> | |
159 | + </property> | |
160 | + <property name="palette"> | |
161 | + <palette> | |
162 | + <active> | |
163 | + <colorrole role="WindowText"> | |
164 | + <brush brushstyle="SolidPattern"> | |
165 | + <color alpha="255"> | |
166 | + <red>255</red> | |
167 | + <green>255</green> | |
168 | + <blue>255</blue> | |
169 | + </color> | |
170 | + </brush> | |
171 | + </colorrole> | |
172 | + </active> | |
173 | + <inactive> | |
174 | + <colorrole role="WindowText"> | |
175 | + <brush brushstyle="SolidPattern"> | |
176 | + <color alpha="255"> | |
177 | + <red>255</red> | |
178 | + <green>255</green> | |
179 | + <blue>255</blue> | |
180 | + </color> | |
181 | + </brush> | |
182 | + </colorrole> | |
183 | + </inactive> | |
184 | + <disabled> | |
185 | + <colorrole role="WindowText"> | |
186 | + <brush brushstyle="SolidPattern"> | |
187 | + <color alpha="255"> | |
188 | + <red>123</red> | |
189 | + <green>123</green> | |
190 | + <blue>123</blue> | |
191 | + </color> | |
192 | + </brush> | |
193 | + </colorrole> | |
194 | + </disabled> | |
195 | + </palette> | |
196 | + </property> | |
197 | + <property name="font"> | |
198 | + <font> | |
199 | + <family>Malgun Gothic</family> | |
200 | + <pointsize>12</pointsize> | |
201 | + </font> | |
202 | + </property> | |
203 | + <property name="text"> | |
204 | + <string>RPM</string> | |
205 | + </property> | |
206 | + </widget> | |
207 | + <widget class="QLabel" name="label_11"> | |
208 | + <property name="geometry"> | |
209 | + <rect> | |
210 | + <x>55</x> | |
211 | + <y>1020</y> | |
212 | + <width>331</width> | |
213 | + <height>70</height> | |
214 | + </rect> | |
215 | + </property> | |
216 | + <property name="palette"> | |
217 | + <palette> | |
218 | + <active> | |
219 | + <colorrole role="WindowText"> | |
220 | + <brush brushstyle="SolidPattern"> | |
221 | + <color alpha="255"> | |
222 | + <red>255</red> | |
223 | + <green>255</green> | |
224 | + <blue>255</blue> | |
225 | + </color> | |
226 | + </brush> | |
227 | + </colorrole> | |
228 | + </active> | |
229 | + <inactive> | |
230 | + <colorrole role="WindowText"> | |
231 | + <brush brushstyle="SolidPattern"> | |
232 | + <color alpha="255"> | |
233 | + <red>255</red> | |
234 | + <green>255</green> | |
235 | + <blue>255</blue> | |
236 | + </color> | |
237 | + </brush> | |
238 | + </colorrole> | |
239 | + </inactive> | |
240 | + <disabled> | |
241 | + <colorrole role="WindowText"> | |
242 | + <brush brushstyle="SolidPattern"> | |
243 | + <color alpha="255"> | |
244 | + <red>123</red> | |
245 | + <green>123</green> | |
246 | + <blue>123</blue> | |
247 | + </color> | |
248 | + </brush> | |
249 | + </colorrole> | |
250 | + </disabled> | |
251 | + </palette> | |
252 | + </property> | |
253 | + <property name="font"> | |
254 | + <font> | |
255 | + <family>Malgun Gothic</family> | |
256 | + <pointsize>12</pointsize> | |
257 | + </font> | |
258 | + </property> | |
259 | + <property name="text"> | |
260 | + <string>Max-RPM</string> | |
261 | + </property> | |
262 | + </widget> | |
263 | + <widget class="QLabel" name="label_10"> | |
264 | + <property name="geometry"> | |
265 | + <rect> | |
266 | + <x>55</x> | |
267 | + <y>785</y> | |
268 | + <width>271</width> | |
269 | + <height>70</height> | |
270 | + </rect> | |
271 | + </property> | |
272 | + <property name="palette"> | |
273 | + <palette> | |
274 | + <active> | |
275 | + <colorrole role="WindowText"> | |
276 | + <brush brushstyle="SolidPattern"> | |
277 | + <color alpha="255"> | |
278 | + <red>255</red> | |
279 | + <green>255</green> | |
280 | + <blue>255</blue> | |
281 | + </color> | |
282 | + </brush> | |
283 | + </colorrole> | |
284 | + </active> | |
285 | + <inactive> | |
286 | + <colorrole role="WindowText"> | |
287 | + <brush brushstyle="SolidPattern"> | |
288 | + <color alpha="255"> | |
289 | + <red>255</red> | |
290 | + <green>255</green> | |
291 | + <blue>255</blue> | |
292 | + </color> | |
293 | + </brush> | |
294 | + </colorrole> | |
295 | + </inactive> | |
296 | + <disabled> | |
297 | + <colorrole role="WindowText"> | |
298 | + <brush brushstyle="SolidPattern"> | |
299 | + <color alpha="255"> | |
300 | + <red>123</red> | |
301 | + <green>123</green> | |
302 | + <blue>123</blue> | |
303 | + </color> | |
304 | + </brush> | |
305 | + </colorrole> | |
306 | + </disabled> | |
307 | + </palette> | |
308 | + </property> | |
309 | + <property name="font"> | |
310 | + <font> | |
311 | + <family>Malgun Gothic</family> | |
312 | + <pointsize>12</pointsize> | |
313 | + </font> | |
314 | + </property> | |
315 | + <property name="text"> | |
316 | + <string>Min-RPM</string> | |
317 | + </property> | |
318 | + </widget> | |
319 | + <widget class="QLabel" name="label_6"> | |
320 | + <property name="geometry"> | |
321 | + <rect> | |
322 | + <x>18</x> | |
323 | + <y>980</y> | |
324 | + <width>863</width> | |
325 | + <height>1</height> | |
326 | + </rect> | |
327 | + </property> | |
328 | + <property name="text"> | |
329 | + <string/> | |
330 | + </property> | |
331 | + <property name="pixmap"> | |
332 | + <pixmap resource="resources.qrc">:/images/line/manual_core_temp_horizontal.png</pixmap> | |
333 | + </property> | |
334 | + </widget> | |
335 | + <widget class="QLabel" name="titleLabel"> | |
336 | + <property name="geometry"> | |
337 | + <rect> | |
338 | + <x>55</x> | |
339 | + <y>426</y> | |
340 | + <width>845</width> | |
341 | + <height>84</height> | |
342 | + </rect> | |
343 | + </property> | |
344 | + <property name="palette"> | |
345 | + <palette> | |
346 | + <active> | |
347 | + <colorrole role="WindowText"> | |
348 | + <brush brushstyle="SolidPattern"> | |
349 | + <color alpha="255"> | |
350 | + <red>255</red> | |
351 | + <green>255</green> | |
352 | + <blue>255</blue> | |
353 | + </color> | |
354 | + </brush> | |
355 | + </colorrole> | |
356 | + </active> | |
357 | + <inactive> | |
358 | + <colorrole role="WindowText"> | |
359 | + <brush brushstyle="SolidPattern"> | |
360 | + <color alpha="255"> | |
361 | + <red>255</red> | |
362 | + <green>255</green> | |
363 | + <blue>255</blue> | |
364 | + </color> | |
365 | + </brush> | |
366 | + </colorrole> | |
367 | + </inactive> | |
368 | + <disabled> | |
369 | + <colorrole role="WindowText"> | |
370 | + <brush brushstyle="SolidPattern"> | |
371 | + <color alpha="255"> | |
372 | + <red>123</red> | |
373 | + <green>123</green> | |
374 | + <blue>123</blue> | |
375 | + </color> | |
376 | + </brush> | |
377 | + </colorrole> | |
378 | + </disabled> | |
379 | + </palette> | |
380 | + </property> | |
381 | + <property name="font"> | |
382 | + <font> | |
383 | + <family>Malgun Gothic</family> | |
384 | + <pointsize>9</pointsize> | |
385 | + </font> | |
386 | + </property> | |
387 | + <property name="text"> | |
388 | + <string>서비스단계(엔지니어모드) > 기능테스트 > 연소가스동작 > 건열송풍기(상)</string> | |
389 | + </property> | |
390 | + </widget> | |
391 | + <widget class="QPushButton" name="maxButton"> | |
392 | + <property name="geometry"> | |
393 | + <rect> | |
394 | + <x>697</x> | |
395 | + <y>1125</y> | |
396 | + <width>184</width> | |
397 | + <height>70</height> | |
398 | + </rect> | |
399 | + </property> | |
400 | + <property name="sizePolicy"> | |
401 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
402 | + <horstretch>0</horstretch> | |
403 | + <verstretch>0</verstretch> | |
404 | + </sizepolicy> | |
405 | + </property> | |
406 | + <property name="font"> | |
407 | + <font> | |
408 | + <family>Roboto</family> | |
409 | + <pointsize>10</pointsize> | |
410 | + <weight>75</weight> | |
411 | + <bold>true</bold> | |
412 | + </font> | |
413 | + </property> | |
414 | + <property name="styleSheet"> | |
415 | + <string notr="true">QPushButton { border-image: url(:/images/button/184.png); } | |
416 | +QPushButton:pressed, QPushButton:focus { border-image: url(:/images/button/184_ov.png); }</string> | |
417 | + </property> | |
418 | + <property name="text"> | |
419 | + <string>START</string> | |
420 | + </property> | |
421 | + </widget> | |
422 | + <widget class="QLabel" name="label_12"> | |
423 | + <property name="geometry"> | |
424 | + <rect> | |
425 | + <x>18</x> | |
426 | + <y>745</y> | |
427 | + <width>863</width> | |
428 | + <height>1</height> | |
429 | + </rect> | |
430 | + </property> | |
431 | + <property name="text"> | |
432 | + <string/> | |
433 | + </property> | |
434 | + <property name="pixmap"> | |
435 | + <pixmap resource="resources.qrc">:/images/line/manual_core_temp_horizontal.png</pixmap> | |
436 | + </property> | |
437 | + </widget> | |
438 | + <widget class="QLabel" name="label_13"> | |
439 | + <property name="geometry"> | |
440 | + <rect> | |
441 | + <x>18</x> | |
442 | + <y>1215</y> | |
443 | + <width>863</width> | |
444 | + <height>1</height> | |
445 | + </rect> | |
446 | + </property> | |
447 | + <property name="text"> | |
448 | + <string/> | |
449 | + </property> | |
450 | + <property name="pixmap"> | |
451 | + <pixmap resource="resources.qrc">:/images/line/manual_core_temp_horizontal.png</pixmap> | |
452 | + </property> | |
453 | + </widget> | |
454 | + <widget class="QLabel" name="rpmLabel"> | |
455 | + <property name="geometry"> | |
456 | + <rect> | |
457 | + <x>55</x> | |
458 | + <y>610</y> | |
459 | + <width>231</width> | |
460 | + <height>70</height> | |
461 | + </rect> | |
462 | + </property> | |
463 | + <property name="palette"> | |
464 | + <palette> | |
465 | + <active> | |
466 | + <colorrole role="WindowText"> | |
467 | + <brush brushstyle="SolidPattern"> | |
468 | + <color alpha="255"> | |
469 | + <red>255</red> | |
470 | + <green>255</green> | |
471 | + <blue>255</blue> | |
472 | + </color> | |
473 | + </brush> | |
474 | + </colorrole> | |
475 | + </active> | |
476 | + <inactive> | |
477 | + <colorrole role="WindowText"> | |
478 | + <brush brushstyle="SolidPattern"> | |
479 | + <color alpha="255"> | |
480 | + <red>255</red> | |
481 | + <green>255</green> | |
482 | + <blue>255</blue> | |
483 | + </color> | |
484 | + </brush> | |
485 | + </colorrole> | |
486 | + </inactive> | |
487 | + <disabled> | |
488 | + <colorrole role="WindowText"> | |
489 | + <brush brushstyle="SolidPattern"> | |
490 | + <color alpha="255"> | |
491 | + <red>123</red> | |
492 | + <green>123</green> | |
493 | + <blue>123</blue> | |
494 | + </color> | |
495 | + </brush> | |
496 | + </colorrole> | |
497 | + </disabled> | |
498 | + </palette> | |
499 | + </property> | |
500 | + <property name="font"> | |
501 | + <font> | |
502 | + <family>Malgun Gothic</family> | |
503 | + <pointsize>11</pointsize> | |
504 | + </font> | |
505 | + </property> | |
506 | + <property name="text"> | |
507 | + <string>0 rpm</string> | |
508 | + </property> | |
509 | + </widget> | |
154 | 510 | </widget> |
155 | 511 | </widget> |
156 | 512 | <customwidgets> |
... | ... | @@ -181,6 +537,8 @@ QPushButton:pressed { |
181 | 537 | <header>digitalclock.h</header> |
182 | 538 | </customwidget> |
183 | 539 | </customwidgets> |
184 | - <resources/> | |
540 | + <resources> | |
541 | + <include location="resources.qrc"/> | |
542 | + </resources> | |
185 | 543 | <connections/> |
186 | 544 | </ui> | ... | ... |
app/gui/oven_control/udphandler.h
... | ... | @@ -31,6 +31,8 @@ public: |
31 | 31 | |
32 | 32 | bool init(); |
33 | 33 | |
34 | + const oven_control_t &getControl() { return control; } | |
35 | + const oven_state_t &getData() { return state; } | |
34 | 36 | |
35 | 37 | bool burner1() { return (state.onoff_state1 & 0x0001) != 0; } |
36 | 38 | bool burner2() { return (state.onoff_state1 & 0x0002) != 0; } | ... | ... |