Commit c543cf8e673e3ec9af3a52307c54884be00358da
1 parent
f6c5254431
Exists in
master
and in
2 other branches
환경 설정 대응 및 디버깅 메시지 정리
- 실시간 형식 반영
Showing
2 changed files
with
31 additions
and
3 deletions
 
Show diff stats
app/gui/oven_control/ovenstatics.cpp
app/gui/oven_control/stringer.cpp
| ... | ... | @@ -39,6 +39,21 @@ int toFahrenheit(int celsius) | 
| 39 | 39 | { | 
| 40 | 40 | return celsius * 1.8 + 32; | 
| 41 | 41 | } | 
| 42 | + | |
| 43 | +enum RealTimeFormat { UseAmPm, Use24 }; | |
| 44 | +RealTimeFormat realTimeFormat() | |
| 45 | +{ | |
| 46 | + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_time_type); | |
| 47 | + switch (item.d32) | |
| 48 | + { | |
| 49 | + case Define::time_type_12h: | |
| 50 | + return UseAmPm; | |
| 51 | + case Define::time_type_24h: | |
| 52 | + default: | |
| 53 | + return Use24; | |
| 54 | + } | |
| 55 | +} | |
| 56 | + | |
| 42 | 57 | } | 
| 43 | 58 | |
| 44 | 59 | QString Stringer::remainingTime(int msecs) | 
| ... | ... | @@ -54,7 +69,14 @@ QString Stringer::remainingTime(int msecs) | 
| 54 | 69 | |
| 55 | 70 | return QString("%1초").arg(msecs); | 
| 56 | 71 | case FinishTime: | 
| 57 | - return QDateTime::currentDateTime().addMSecs(msecs).toString("HH:mm:ss"); | |
| 72 | + QDateTime dateTime = QDateTime::currentDateTime().addMSecs(msecs); | |
| 73 | + switch (realTimeFormat()) | |
| 74 | + { | |
| 75 | + case UseAmPm: | |
| 76 | + return dateTime.toString("A hh:mm:ss"); | |
| 77 | + case Use24: | |
| 78 | + return dateTime.toString("HH:mm:ss"); | |
| 79 | + } | |
| 58 | 80 | } | 
| 59 | 81 | |
| 60 | 82 | return QString(); | 
| ... | ... | @@ -83,7 +105,14 @@ QString Stringer::remainingTime(int msecs, QString style) | 
| 83 | 105 | |
| 84 | 106 | return style + heavySpan.arg(msecs) + lightSpan.arg("초"); | 
| 85 | 107 | case FinishTime: | 
| 86 | - return heavySpan.arg(QDateTime::currentDateTime().addMSecs(msecs).toString("HH:mm:ss")); | |
| 108 | + QDateTime dateTime = QDateTime::currentDateTime().addMSecs(msecs); | |
| 109 | + switch (realTimeFormat()) | |
| 110 | + { | |
| 111 | + case UseAmPm: | |
| 112 | + return heavySpan.arg(dateTime.toString("A hh:mm:ss")); | |
| 113 | + case Use24: | |
| 114 | + return heavySpan.arg(dateTime.toString("HH:mm:ss")); | |
| 115 | + } | |
| 87 | 116 | } | 
| 88 | 117 | |
| 89 | 118 | return QString(); | ... | ... |