f588aa273
김태훈
부가 기능 로직 추가
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
AutoCookSettingWidget::AutoCookSettingWidget(AutoCookSetting setting, QWidget *parent) :
QWidget(parent),
ui(new Ui::AutoCookSettingWidget)
{
ui->setupUi(this);
Cook cook(setting.type, setting.root, setting.name);
cook.setConfig(setting.configs[0],
setting.configs[1],
setting.configs[2],
setting.configs[3],
setting.configs[4]);
configWidgets.append(
ConfigWidget {
ui->configButton_1,
ui->configMinLabel_1,
ui->configMaxLabel_1,
ui->configCurrentLabel_1,
ui->configSlider_1
});
configWidgets.append(
ConfigWidget {
ui->configButton_2,
ui->configMinLabel_2,
ui->configMaxLabel_2,
ui->configCurrentLabel_2,
ui->configSlider_2
});
configWidgets.append(
ConfigWidget {
ui->configButton_3,
ui->configMinLabel_3,
ui->configMaxLabel_3,
ui->configCurrentLabel_3,
ui->configSlider_3
});
configWidgets.append(
ConfigWidget {
ui->configButton_4,
ui->configMinLabel_4,
ui->configMaxLabel_4,
ui->configCurrentLabel_4,
ui->configSlider_4
});
configWidgets.append(
ConfigWidget {
ui->configButton_5,
ui->configMinLabel_5,
ui->configMaxLabel_5,
ui->configCurrentLabel_5,
ui->configSlider_5
});
setupUi(cook);
}
AutoCookSettingWidget::~AutoCookSettingWidget()
{
delete ui;
}
void AutoCookSettingWidget::setupUi(Cook cook)
{
ui->cookTypeIcon->setPixmap(Define::icon(cook.type));
ui->selectCookButton->setText(cook.name);
|
f588aa273
김태훈
부가 기능 로직 추가
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
for (int idx = 0; idx < 5; idx++)
{
ConfigWidget cw = configWidgets.at(idx);
CookConfig config = cook.configs[idx];
if (config.type == Define::ConfigNotUsed)
{
cw.button->hide();
cw.minimum->hide();
cw.maximum->hide();
cw.current->hide();
cw.slider->hide();
}
else
{
|
f588aa273
김태훈
부가 기능 로직 추가
|
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
cw.minimum->setText(Define::minimum(config.type));
cw.maximum->setText(Define::maximum(config.type));
cw.slider->blockSignals(true);
cw.slider->setMinimum(1);
cw.slider->setMaximum(config.maximum);
cw.slider->setValue(config.current);
cw.slider->blockSignals(false);
switch (config.type)
{
case Define::Time:
cw.slider->setProperty("sliderColor", "white");
break;
case Define::BurnDegree:
cw.slider->setProperty("sliderColor", "yellow");
break;
case Define::Brightness:
cw.slider->setProperty("sliderColor", "red");
break;
default:
cw.slider->setProperty("sliderColor", "blue");
break;
}
switch (config.type)
{
case Define::Time:
|
f588aa273
김태훈
부가 기능 로직 추가
|
127
128
129
130
131
132
133
134
135
136
137
|
break;
default:
cw.current->setText(QString().sprintf(
"%d"
"<span style=\"font-size:11pt;\">/%d</span>",
config.current, config.maximum));
break;
}
}
}
}
|