issue #10 #11 Change operation method for using debug option.

This commit is contained in:
Paul Kim
2024-04-11 17:05:06 +09:00
parent fe71eb5561
commit ed75e5f8fb
9 changed files with 91 additions and 272 deletions

View File

@@ -812,7 +812,7 @@ HotelTV.api = (function() {
"second": 344632,
"string": "03d23h43m52s"
},
"api_ver": "v1"
"api_ver": "v3"
};
const _fxn_cvtDateFmt1 = function(_date) {

View File

@@ -120,9 +120,9 @@ HotelTV.namespace = function(ns_string) {
* @param {string} sz_key property key name.
* @param {callback} callback is callback object
*/
function __fxn_Set_DebugOpt() {
HotelTV.dbginfo['en'] = true;
HotelTV.dbginfo['output'] = 'native';
function __fxn_Set_DebugOpt(_enable, _out_option, _init) {
HotelTV.dbginfo['en'] = _enable;
HotelTV.dbginfo['output'] = _out_option;
HotelTV.hcap.Init();
@@ -142,9 +142,9 @@ function __fxn_Set_DebugOpt() {
if (HotelTV.dbginfo['output'] == 'osd') {
if (HotelTV.dbginfo['en'] == true) {
(function() {
var old = console.log;
var logger = document.getElementById('debugwin');
var logger = document.getElementById('debugwin');
if ( logger!=null )
{
var dateNow = new Date();
var hours = dateNow.getHours();
var minutes = dateNow.getMinutes();
@@ -158,6 +158,11 @@ function __fxn_Set_DebugOpt() {
if (seconds < 10) {
seconds = "0" + seconds;
}
if(logger.style.display!='block'){
logger.style.display = 'block';
}
console.log = function(logmsg) {
var _dispMsg = hours + ":" + minutes + ":" + seconds + "-> ";
if (typeof logmsg == 'object') {
@@ -166,18 +171,20 @@ function __fxn_Set_DebugOpt() {
_dispMsg += logmsg + '<br />';
}
_dispMsg += logger.innerHTML;
logger.innerHTML = _dispMsg;
}
})();
}
}
} else {
/** Set HCAP Debug Options */
if (HotelTV.dbginfo['emulator'] == false) {
//Enable/Disable browser debug mode
HotelTV.hcap.SetBrowserDebug(HotelTV.dbginfo['hcap_ipc'], HotelTV.dbginfo['en']);
} else {
//Below for Non WebOS
}
if (HotelTV.dbginfo['en'] != true) {
console.log = function(logmsg) {
}
}
}
};
@@ -192,7 +199,7 @@ HotelTV.Init = async function() {
HotelTV.hcap.ChannelShutDown();
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt();
__fxn_Set_DebugOpt(false, 'osd', false);
//STEP#03::> Get Device Info
HotelTV.ui_utils.SetBusy(true);
@@ -200,7 +207,7 @@ HotelTV.Init = async function() {
await HotelTV.hcap.GetDevInfo();
//await HotelTV.hcap.ShowDevInfo();
} catch (_error) {
let _tmval = 10;
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-devinfo",
"SYSTEM ERROR",
@@ -392,6 +399,7 @@ HotelTV.Init = async function() {
try {
HotelTV.widget = await HotelTV.api.GetWidgetCtz();
} catch (_error) {
let _tmval = 50;
//console.log("Display Error page for get widget info");
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-widget",
@@ -415,6 +423,7 @@ HotelTV.Init = async function() {
try {
HotelTV.tvguide = await HotelTV.api.GetProgramCtz();
} catch (_error) {
let _tmval = 50;
//console.log("Display Error page for get tvguide info");
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-tvguideinfo",
@@ -484,7 +493,25 @@ HotelTV.Init = async function() {
}
}
} else {
console.error("Display Error page for invalid license type.");
let _tmval = 30;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.unregistered-device",
"SYSTEM ERROR",
"This device is not a registered device or is an invalid licensed device.\r\nplease contact your system administrator.",
{
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem need to be reboot`);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
},
"cb_eoe": function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nPlease reboot the device by manualy(using remote contoller)`);
}
}
);
}
console.log("Initialization:: Done");
HotelTV.ui_utils.SetBusy(false);
@@ -497,6 +524,9 @@ HotelTV.LoadWelCome = async function() {
extDisableHcapConsoleLog = true;
HotelTV.dbginfo = await JSON.parse(sessionStorage.getItem("dbginfo"));
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt(true, 'osd', true);
HotelTV.devinfo = await JSON.parse(sessionStorage.getItem("devinfo"));
HotelTV.svrinfo = await JSON.parse(sessionStorage.getItem("svrinfo"));
//STEP#03:API Module INIT
@@ -630,6 +660,9 @@ HotelTV.LoadAppFull = async function() {
//STEP#01: Load session info
HotelTV.dbginfo = await JSON.parse(sessionStorage.getItem("dbginfo"));
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt(false, 'native', true);
HotelTV.devinfo = await JSON.parse(sessionStorage.getItem("devinfo"));
HotelTV.svrinfo = await JSON.parse(sessionStorage.getItem("svrinfo"));
HotelTV.services = await JSON.parse(sessionStorage.getItem("services"));

View File

@@ -65,7 +65,7 @@ HotelTV.ui_appfull = (function() {
var _hndl_tmrCtzBgAni = null;
var _hndl_tmrAmenityThumbAni = null;
var _hndl_tmrRoomserviceThumbAni = null;
const _lastTm = {
const _tmrEvt = {
'tvchannel_changed': null,
'keyevt': {
'tv_num' :null,
@@ -300,13 +300,13 @@ HotelTV.ui_appfull = (function() {
let _cur_date = new Date();
if ( __uifxn_Utils_CheckKeyisNumber(_evt.keyCode)==true ){
_lastTm.keyevt.tv_num = _cur_date;
_tmrEvt.keyevt.tv_num = _cur_date;
} else if ( _evt.keyCode == gRmtKey.up || _evt.keyCode == gRmtKey.down ||
_evt.keyCode == gRmtKey.left || _evt.keyCode == gRmtKey.right ||
_evt.keyCode == gRmtKey.chup || _evt.keyCode == gRmtKey.chdown ) {
_lastTm.keyevt.tv_ctrl = _cur_date;
_tmrEvt.keyevt.tv_ctrl = _cur_date;
}
_lastTm.keyevt.last = _cur_date;
_tmrEvt.keyevt.last = _cur_date;
}
@@ -3926,14 +3926,14 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
let _tm_diff_ms_tvctrl = 0;
if (_lastTm.keyevt.tv_ctrl == null) {
if (_tmrEvt.keyevt.tv_ctrl == null) {
return;
}
let _tm_cur = new Date();
_tm_diff_ms_tvctrl = Math.floor(_tm_cur.getTime() - _lastTm.keyevt.tv_ctrl.getTime());
_tm_diff_ms_tvctrl = Math.floor(_tm_cur.getTime() - _tmrEvt.keyevt.tv_ctrl.getTime());
//마지막 KEY 이벤트 수신 시간 갱신
//console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt.tv_ctrl} TMDiff::> ${_tm_diff_ms}`);
//console.log(`KeyDn Event Recoreded::> ${_tmrEvt.keyevt.tv_ctrl} TMDiff::> ${_tm_diff_ms}`);
// TV Channel UI 지속 시간 2초
if ( _state.menu.stage.cur=="tvShortcut" )
@@ -4567,14 +4567,14 @@ HotelTV.ui_appfull = (function() {
let _need_to_changeTVChannel = false;
let _tm_diff_ms = 0;
if (_lastTm.tvchannel_changed == null) {
_lastTm.tvchannel_changed = new Date();
if (_tmrEvt.tvchannel_changed == null) {
_tmrEvt.tvchannel_changed = new Date();
_need_to_changeTVChannel = true;
} else {
let _tm_cur = new Date();
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _lastTm.tvchannel_changed.getTime());
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _tmrEvt.tvchannel_changed.getTime());
//마지막 TV채널 변경 시간 갱신
_lastTm.tvchannel_changed = _tm_cur;
_tmrEvt.tvchannel_changed = _tm_cur;
if (_tm_diff_ms > 200) {
_need_to_changeTVChannel = true;
@@ -5580,8 +5580,8 @@ HotelTV.ui_appfull = (function() {
}
// 초기 채널 카테고리 슬라이더 표시 시간 증가
_lastTm.keyevt.tv_ctrl = new Date();
_lastTm.keyevt.tv_ctrl.setSeconds(_lastTm.keyevt.tv_ctrl.getSeconds() + 3);
_tmrEvt.keyevt.tv_ctrl = new Date();
_tmrEvt.keyevt.tv_ctrl.setSeconds(_tmrEvt.keyevt.tv_ctrl.getSeconds() + 3);
if (!(_mmIdx in _state.menu.main)) {
_state.menu.main[_mmIdx] = {
@@ -5791,8 +5791,8 @@ HotelTV.ui_appfull = (function() {
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
_lastTm.keyevt.tv_ctrl = new Date();
_lastTm.keyevt.tv_ctrl.setSeconds(_lastTm.keyevt.tv_ctrl.getSeconds() - 3);
_tmrEvt.keyevt.tv_ctrl = new Date();
_tmrEvt.keyevt.tv_ctrl.setSeconds(_tmrEvt.keyevt.tv_ctrl.getSeconds() - 3);
} else {
__uifxn_AppFull_TVDrawShortCutList(true, "move", event.keyCode);
console.log("TVSHORTCUT CHNUM: " + _state.tv.shortkey.ch_item_idx);
@@ -5849,16 +5849,16 @@ HotelTV.ui_appfull = (function() {
let _tm_diff_ms = 0;
if (_lastTm.keyevt.last == null) {
_lastTm.keyevt.last = new Date();
if (_tmrEvt.keyevt.last == null) {
_tmrEvt.keyevt.last = new Date();
console.log("keyevt.last is NULL");
return;
}
let _tm_cur = new Date();
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _lastTm.keyevt.last.getTime());
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _tmrEvt.keyevt.last.getTime());
//마지막 KEY 이벤트 수신 시간 갱신
//console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt.last} TMDiff::> ${_tm_diff_ms}`);
//console.log(`KeyDn Event Recoreded::> ${_tmrEvt.keyevt.last} TMDiff::> ${_tm_diff_ms}`);
if (_state.menu.stage.cur == "mypage_popup_message_card") {
//HIDE NEWS and USER GUIDE TIPS