issue #10 HDMI입력시 화면 전환 기능 추가. Welcome에서 MQTT메시지 처리 로직 추가.

This commit is contained in:
Paul Kim
2023-02-27 22:02:12 +09:00
parent 1e0bafafde
commit 29efea9b97
9 changed files with 583 additions and 283 deletions

View File

@@ -130,68 +130,6 @@ async function sworker_service(args) {
};
let _tm_cur = new Date();
// CHECK EPG INFORMATION UPDATE
if (g_tm_prev.epg == null) {
g_tm_prev.epg = new Date();
_bNeed_Update.epg = true;
} else {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.epg.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//EPG정보는 매 30분 마다 한번씩 업데이트
if (_tm_diff_s > 1800) {
//if (_tm_diff_s > 60) {
g_tm_prev.epg = _tm_cur;
_bNeed_Update.epg = true;
}
}
// CHECK NEWS INFORMATION UPDATE
if (g_tm_prev.news == null) {
g_tm_prev.news = new Date();
_bNeed_Update.news = true;
} else {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.news.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//NEWS정보는 매 20분 마다 한번씩 업데이트
if (_tm_diff_s > 1200) {
g_tm_prev.news = _tm_cur;
_bNeed_Update.news = true;
}
}
// CHECK FLIGHT INFORMATION UPDATE
if (g_tm_prev.flight == null) {
g_tm_prev.flight = new Date();
_bNeed_Update.flight = true;
} else {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.flight.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//FLIGHT정보는 매 60분 마다 한번씩 업데이트
if (_tm_diff_s > 3600) {
g_tm_prev.flight = _tm_cur;
_bNeed_Update.flight = true;
}
}
// CHECK WEATHER INFORMATION UPDATE
if (g_tm_prev.weather == null) {
g_tm_prev.weather = new Date();
_bNeed_Update.weather = true;
} else {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.weather.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//NEWS정보는 매 2시간 마다 한번씩 업데이트
if (_tm_diff_s > 7200) {
g_tm_prev.weather = _tm_cur;
_bNeed_Update.weather = true;
}
}
// CHECK REPORT INFORMATION UPDATE
if (g_tm_prev.report == null) {
@@ -205,9 +143,78 @@ async function sworker_service(args) {
if (_tm_diff_s > 5) {
g_tm_prev.report = _tm_cur;
_bNeed_Update.report = true;
if (g_tm_prev.epg == null) {
g_tm_prev.epg = _tm_cur;
}
if (g_tm_prev.news == null) {
g_tm_prev.news = _tm_cur;
}
if (g_tm_prev.flight == null) {
g_tm_prev.flight = _tm_cur;
}
if (g_tm_prev.weather == null) {
g_tm_prev.weather = _tm_cur;
}
}
}
// CHECK EPG INFORMATION UPDATE
if (g_tm_prev.epg != null) {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.epg.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//EPG정보는 매 30분 마다 한번씩 업데이트
if (_tm_diff_s > 1800) {
//if (_tm_diff_s > 60) {
g_tm_prev.epg = _tm_cur;
_bNeed_Update.epg = true;
}
}
// CHECK NEWS INFORMATION UPDATE
if (g_tm_prev.news != null) {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.news.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//NEWS정보는 매 20분 마다 한번씩 업데이트
if (_tm_diff_s > 1200) {
g_tm_prev.news = _tm_cur;
_bNeed_Update.news = true;
}
}
// CHECK FLIGHT INFORMATION UPDATE
if (g_tm_prev.flight != null) {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.flight.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//FLIGHT정보는 매 60분 마다 한번씩 업데이트
if (_tm_diff_s > 3600) {
g_tm_prev.flight = _tm_cur;
_bNeed_Update.flight = true;
}
}
// CHECK WEATHER INFORMATION UPDATE
if (g_tm_prev.weather != null) {
let _tm_diff_ms = _tm_cur.getTime() - g_tm_prev.weather.getTime();
let _tm_diff_s = Math.floor(_tm_diff_ms / 1000);
//WEATHER정보는 매 2시간 마다 한번씩 업데이트
if (_tm_diff_s > 7200) {
g_tm_prev.weather = _tm_cur;
_bNeed_Update.weather = true;
}
}
// 후처리(실제 데이터 가져오고 부모에세 메시지로 안내)
if (_bNeed_Update.epg === true) {