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

@@ -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"));