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

@@ -34,7 +34,7 @@ HotelTV.ui_welcome = (function() {
//Hide welcome page
__uifxn_WC_Show(null, function() {
_state.menu.stage = "playWelcomeMovie";
_state.menu.stage.cur = "playWelcomeMovie";
$('#lst_langsel').off('changed.owl.carousel');
$('#lst_langsel').owlCarousel('destroy');
@@ -238,7 +238,7 @@ HotelTV.ui_welcome = (function() {
hndl_langSel = $('#lst_langsel');
hndl_langSel.owlCarousel({
center: true,
items: Number(_langCnt - 1), //Number of Items on Screen what you want
items: 3,//Number(_langCnt - 1), //Number of Items on Screen what you want
loop: true,
margin: 0,
smartSpeed: 700,
@@ -275,7 +275,7 @@ HotelTV.ui_welcome = (function() {
setTimeout(function() {
$('.welcome .frame .msgwin #welcomemsg').fadeIn(500, function() {
$('.welcome .frame .msgwin #guestname').fadeIn(500, function() {
_state.menu.stage = "langSel"
_state.menu.stage.cur = "langSel"
});
});
}, 500);
@@ -286,7 +286,7 @@ HotelTV.ui_welcome = (function() {
$(document).on('keydown', function(_evt) { //attach event listener
console.log("LANGSEL KEY EVENT::> " + _evt.keyCode);
if (_state.menu.stage == "langSel") {
if (_state.menu.stage.cur == "langSel") {
if (_evt.keyCode == 37) {
$('#lst_langsel').trigger('prev.owl')
} else if (_evt.keyCode == 39) {
@@ -343,7 +343,7 @@ HotelTV.ui_welcome = (function() {
console.log("No welcome post contents");
}
}
} else if (_state.menu.stage == "playWelcomeMovie") {
} else if (_state.menu.stage.cur == "playWelcomeMovie") {
if (_evt.keyCode == 413) {
// STOP KEY Event
if (_media_status == 'playing') {
@@ -407,8 +407,101 @@ HotelTV.ui_welcome = (function() {
__uifxn_WC_Show(_ctzWc.background.file.download, null);
},
MqttEvent: function(_evt) {
let _state = HotelTV.state;
console.log("MQTT RECEVED MESSAGE::> " + _evt);
if (_evt == "EVENT-MESSAGE-CREATE" || _evt == "EVENT-MESSAGE-UPDATE" || _evt == "EVENT-MESSAGE-DELETE") {
//DO NOT NEED MESSAGE on WELCOME
} else if (_evt == "EVENT-NEWS-UPDATE") {
//DO NEW NEWS
} else if (_evt == "EVENT-EMERGENCY-START") {
} else if (_evt == "EVENT-EMERGENCY-STOT") {
} else if (_evt == "COMMAND-SYSTEM-RESTART") {
let _tmval = 10;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.system_reboot[_state.lang], {
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-CHECKIN") {
} else if (_evt == "COMMAND-GUEST-CHECKOUT") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.checkout[_state.lang], {
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-UPDATE") {
} else if (_evt == "COMMAND-GUEST-ROOMCHANGE") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.room_change[_state.lang], {
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-LAB-FACTORY") {
} else if (_evt == "COMMAND-LAB-AGING") {
} else if (_evt == "COMMAND-LAB-SHOW-ID") {
}
},
Close: function() {
SpatialNavigation.clear();
},
}
})();