Commit d43c6c1724b59d4adccc3f87a81a70900123b3de

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

안 쓰는 루틴 정리

app/gui/oven_control/autocookselectionwindow.cpp
... ... @@ -76,28 +76,6 @@ void AutoCookSelectionWindow::onCookSelected(int idx)
76 76 w->showFullScreen();
77 77 }
78 78  
79   -void AutoCookSelectionWindow::on_pushButton_clicked()
80   -{
81   - AbstractCook *cook;
82   - switch (type)
83   - {
84   - case Cook::Poultry:
85   - cook = new ChickenCook;
86   - break;
87   - case Cook::Meat:
88   - cook = new MeatPie;
89   - break;
90   - case Cook::Bread:
91   - cook = new Croissant;
92   - break;
93   - default:
94   - return;
95   - }
96   -
97   - AutoCookWindow *w = new AutoCookWindow(this, oven, cook);
98   - w->showFullScreen();
99   -}
100   -
101 79 void AutoCookSelectionWindow::on_backButton_clicked()
102 80 {
103 81 close();
... ...
app/gui/oven_control/autocookselectionwindow.h
... ... @@ -20,7 +20,6 @@ public:
20 20  
21 21 private slots:
22 22 void onCookSelected(int idx);
23   - void on_pushButton_clicked();
24 23  
25 24 void on_backButton_clicked();
26 25  
... ...
app/gui/oven_control/oven_control.pro
... ... @@ -22,7 +22,6 @@ SOURCES += main.cpp\
22 22 manualcookwindow.cpp \
23 23 udphandler.cpp \
24 24 ovencontroller.cpp \
25   - packetprinter.cpp \
26 25 configwindow.cpp \
27 26 functiontestwindow.cpp \
28 27 componenttestwindow.cpp \
... ... @@ -47,7 +46,6 @@ HEADERS += mainwindow.h \
47 46 udphandler.h \
48 47 all_share.h \
49 48 ovencontroller.h \
50   - packetprinter.h \
51 49 configwindow.h \
52 50 functiontestwindow.h \
53 51 componenttestwindow.h \
... ... @@ -65,7 +63,6 @@ HEADERS += mainwindow.h \
65 63  
66 64 FORMS += mainwindow.ui \
67 65 manualcookwindow.ui \
68   - packetprinter.ui \
69 66 configwindow.ui \
70 67 functiontestwindow.ui \
71 68 componenttestwindow.ui \
... ...
app/gui/oven_control/packetprinter.cpp
... ... @@ -1,50 +0,0 @@
1   -#include "packetprinter.h"
2   -#include "ui_packetprinter.h"
3   -
4   -#include <QTextStream>
5   -
6   -#include "all_share.h"
7   -
8   -PacketPrinter::PacketPrinter(QWidget *parent) :
9   - QMainWindow(parent),
10   - ui(new Ui::PacketPrinter)
11   -{
12   - ui->setupUi(this);
13   -}
14   -
15   -PacketPrinter::~PacketPrinter()
16   -{
17   - delete ui;
18   -}
19   -
20   -void PacketPrinter::printControl(oven_control_t &control)
21   -{
22   - QString str;
23   - QTextStream stream(&str);
24   -
25   - stream << "Control\n";
26   -
27   - for (int idx = 0; idx < (int) sizeof(control) / sizeof(unsigned short); idx++)
28   - {
29   - QString str;
30   - stream << str.sprintf("0x%04X 0x%04X\n", idx, ((unsigned short *) &control)[idx]);
31   - }
32   -
33   - ui->control->setPlainText(str);
34   -}
35   -
36   -void PacketPrinter::printState(oven_state_t &state)
37   -{
38   -
39   - QString str;
40   - QTextStream stream(&str);
41   - stream << "State\n";
42   -
43   - for (int idx = 0; idx < (int) sizeof(state) / sizeof(unsigned short); idx++)
44   - {
45   - QString str;
46   - stream << str.sprintf("0x%04X 0x%04X\n", idx, ((unsigned short *) &state)[idx]);
47   - }
48   -
49   - ui->state->setPlainText(str);
50   -}
app/gui/oven_control/packetprinter.h
... ... @@ -1,27 +0,0 @@
1   -#ifndef PACKETPRINTER_H
2   -#define PACKETPRINTER_H
3   -
4   -#include <QMainWindow>
5   -
6   -#include "all_share.h"
7   -
8   -namespace Ui {
9   -class PacketPrinter;
10   -}
11   -
12   -class PacketPrinter : public QMainWindow
13   -{
14   - Q_OBJECT
15   -
16   -public:
17   - explicit PacketPrinter(QWidget *parent = 0);
18   - ~PacketPrinter();
19   -
20   - void printControl(oven_control_t &control);
21   - void printState(oven_state_t &state);
22   -
23   -private:
24   - Ui::PacketPrinter *ui;
25   -};
26   -
27   -#endif // PACKETPRINTER_H
app/gui/oven_control/packetprinter.ui
... ... @@ -1,41 +0,0 @@
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<ui version="4.0">
3   - <class>PacketPrinter</class>
4   - <widget class="QMainWindow" name="PacketPrinter">
5   - <property name="geometry">
6   - <rect>
7   - <x>0</x>
8   - <y>0</y>
9   - <width>367</width>
10   - <height>928</height>
11   - </rect>
12   - </property>
13   - <property name="windowTitle">
14   - <string>MainWindow</string>
15   - </property>
16   - <widget class="QWidget" name="centralwidget">
17   - <layout class="QHBoxLayout" name="horizontalLayout">
18   - <item>
19   - <widget class="QPlainTextEdit" name="control">
20   - <property name="font">
21   - <font>
22   - <family>NanumGothicCoding</family>
23   - </font>
24   - </property>
25   - </widget>
26   - </item>
27   - <item>
28   - <widget class="QPlainTextEdit" name="state">
29   - <property name="font">
30   - <font>
31   - <family>NanumGothicCoding</family>
32   - </font>
33   - </property>
34   - </widget>
35   - </item>
36   - </layout>
37   - </widget>
38   - </widget>
39   - <resources/>
40   - <connections/>
41   -</ui>
app/gui/oven_control/udphandler.cpp
... ... @@ -13,9 +13,7 @@ typedef struct {
13 13  
14 14 UdpHandler::UdpHandler(QObject *parent) : QObject(parent)
15 15 {
16   -// printer = new PacketPrinter;
17   -// connect(this, SIGNAL(changed()), this, SLOT(printData()));
18   -// printer->show();
  16 +
19 17 }
20 18  
21 19 bool UdpHandler::init()
... ... @@ -111,8 +109,3 @@ void UdpHandler::fillData(oven_state_t &amp;container)
111 109 memcpy(&container, &state, sizeof(state));
112 110 }
113 111  
114   -void UdpHandler::printData()
115   -{
116   - printer->printControl(control);
117   - printer->printState(state);
118   -}
... ...
app/gui/oven_control/udphandler.h
... ... @@ -6,7 +6,6 @@
6 6 #include <QByteArray>
7 7  
8 8 #include "all_share.h"
9   -#include "packetprinter.h"
10 9  
11 10 class UdpHandler : public QObject
12 11 {
... ... @@ -57,12 +56,10 @@ private:
57 56 void processState(oven_state_t *state);
58 57  
59 58 QUdpSocket *sock;
60   - PacketPrinter *printer;
61 59  
62 60 private slots:
63 61 void readPendingDatagrams();
64 62 void sendCommand(int cmd, int target, int value);
65   - void printData();
66 63  
67 64 };
68 65  
... ...