Commit c12f74836a3389d9f11e13e71dfa755520bb99ba
1 parent
1f7568d7e3
Exists in
master
and in
2 other branches
자동 화면 밝기 조절 기능 버그 수정
- 설정 값을 잘못 가져오는 문제 수정 - 의도하지 않은 밝기로 조절되는 문제 수정
Showing
3 changed files
with
27 additions
and
5 deletions
 
Show diff stats
app/gui/oven_control/backlight.cpp
| ... | ... | @@ -5,6 +5,29 @@ | 
| 5 | 5 | namespace { | 
| 6 | 6 | int setting = 7; | 
| 7 | 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 | 33 | void Backlight::lower() | 
| ... | ... | @@ -13,16 +36,16 @@ void Backlight::lower() | 
| 13 | 36 | |
| 14 | 37 | int t = setting - 2; | 
| 15 | 38 | if (t < 0) | 
| 16 | - System::setBacklight(0); | |
| 39 | + System::setBacklight(toSystem(0)); | |
| 17 | 40 | else | 
| 18 | - System::setBacklight(t); | |
| 41 | + System::setBacklight(toSystem(t)); | |
| 19 | 42 | } | 
| 20 | 43 | |
| 21 | 44 | void Backlight::restore() | 
| 22 | 45 | { | 
| 23 | 46 | lowered = false; | 
| 24 | 47 | |
| 25 | - System::setBacklight(setting); | |
| 48 | + System::setBacklight(toSystem(setting)); | |
| 26 | 49 | } | 
| 27 | 50 | |
| 28 | 51 | void Backlight::set(int level) | ... | ... | 
app/gui/oven_control/inputoverwatcher.cpp
| ... | ... | @@ -8,7 +8,7 @@ | 
| 8 | 8 | |
| 9 | 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 | 13 | timer.setSingleShot(true); | 
| 14 | 14 | timer.setInterval(item.d32 * 60000); | ... | ... |