Commit c12f74836a3389d9f11e13e71dfa755520bb99ba

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

자동 화면 밝기 조절 기능 버그 수정

- 설정 값을 잘못 가져오는 문제 수정
- 의도하지 않은 밝기로 조절되는 문제 수정
app/gui/oven_control/backlight.cpp
@@ -5,6 +5,29 @@ @@ -5,6 +5,29 @@
5 namespace { 5 namespace {
6 int setting = 7; 6 int setting = 7;
7 bool lowered = false; 7 bool lowered = false;
  8 +
  9 +int toSystem(int setting)
  10 +{
  11 + switch (setting)
  12 + {
  13 + case 0:
  14 + return 3;
  15 + case 1:
  16 + return 4;
  17 + case 2:
  18 + return 5;
  19 + case 3:
  20 + return 6;
  21 + case 4:
  22 + return 7;
  23 + case 5:
  24 + return 8;
  25 + case 6:
  26 + return 9;
  27 + case 7:
  28 + return 10;
  29 + }
  30 +}
8 } 31 }
9 32
10 void Backlight::lower() 33 void Backlight::lower()
@@ -13,16 +36,16 @@ void Backlight::lower() @@ -13,16 +36,16 @@ void Backlight::lower()
13 36
14 int t = setting - 2; 37 int t = setting - 2;
15 if (t < 0) 38 if (t < 0)
16 - System::setBacklight(0); 39 + System::setBacklight(toSystem(0));
17 else 40 else
18 - System::setBacklight(t); 41 + System::setBacklight(toSystem(t));
19 } 42 }
20 43
21 void Backlight::restore() 44 void Backlight::restore()
22 { 45 {
23 lowered = false; 46 lowered = false;
24 47
25 - System::setBacklight(setting); 48 + System::setBacklight(toSystem(setting));
26 } 49 }
27 50
28 void Backlight::set(int level) 51 void Backlight::set(int level)
app/gui/oven_control/inputoverwatcher.cpp
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 InputOverwatcher::InputOverwatcher(QObject *parent) : QObject(parent) 9 InputOverwatcher::InputOverwatcher(QObject *parent) : QObject(parent)
10 { 10 {
11 - Define::config_item item = Config::getInstance()->getConfigValue(Define::config_backlight); 11 + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_set_auto_darkness);
12 12
13 timer.setSingleShot(true); 13 timer.setSingleShot(true);
14 timer.setInterval(item.d32 * 60000); 14 timer.setInterval(item.d32 * 60000);
app/gui/oven_control/main.cpp
@@ -25,7 +25,6 @@ int main(int argc, char *argv[]) @@ -25,7 +25,6 @@ int main(int argc, char *argv[])
25 OvenStatistics::getInstance(oven); 25 OvenStatistics::getInstance(oven);
26 Config::getInstance(oven); 26 Config::getInstance(oven);
27 27
28 -  
29 MainWindow w; 28 MainWindow w;
30 w.showFullScreen(); 29 w.showFullScreen();
31 30