From 29efea9b9718221912fb2085ca471cbf53a69ac0 Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Mon, 27 Feb 2023 22:02:12 +0900 Subject: [PATCH] =?UTF-8?q?issue=20#10=20HDMI=EC=9E=85=EB=A0=A5=EC=8B=9C?= =?UTF-8?q?=20=ED=99=94=EB=A9=B4=20=EC=A0=84=ED=99=98=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80.=20Welcome=EC=97=90=EC=84=9C=20MQTT?= =?UTF-8?q?=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B2=98=EB=A6=AC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=B6=94=EA=B0=80.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/hoteltv.app.full.ctzgen.css | 19 + procentric/application/lib/hoteltv.api.js | 2 +- procentric/application/lib/hoteltv.hcap.js | 24 +- procentric/application/lib/hoteltv.js | 129 +++++- procentric/application/lib/hoteltv.service.js | 131 +++--- .../application/lib/hoteltv.ui_appfull.js | 431 ++++++++++-------- .../application/lib/hoteltv.ui_utils.js | 23 + .../application/lib/hoteltv.ui_welcome.js | 103 ++++- procentric/application/wellcome.html | 4 + 9 files changed, 583 insertions(+), 283 deletions(-) diff --git a/procentric/application/hoteltv.app.full.ctzgen.css b/procentric/application/hoteltv.app.full.ctzgen.css index c6174f2..284a9e3 100755 --- a/procentric/application/hoteltv.app.full.ctzgen.css +++ b/procentric/application/hoteltv.app.full.ctzgen.css @@ -154,6 +154,25 @@ margin: 0 10px 0 10px; } + + +.main .ctzgen .bg .owl-carousel .owl-item .ctz_imgvwr_frame { + position: absolute; + top: 130px; + width: 1920px; + height: 830px; + color: rgb(255, 255, 255); + background-color: rgba(0, 0, 0, 0.5); + padding: 0px 12px 0px 12px; + overflow: hidden; +} + + + + + + + .main .ctzgen .bg .owl-carousel .owl-item .ctz_mv_ctrl { position: absolute; top: 970px; diff --git a/procentric/application/lib/hoteltv.api.js b/procentric/application/lib/hoteltv.api.js index afb04d3..2032d5b 100755 --- a/procentric/application/lib/hoteltv.api.js +++ b/procentric/application/lib/hoteltv.api.js @@ -641,7 +641,7 @@ HotelTV.api = (function() { let sz_api_url = __apifxn_get_api_url("update_event"); __apifxn_CallCmsApi("POST", sz_api_url, "UpdateEvent", _json_event).then(_result => { - console.log(`Success::>${_result.data}`); + //console.log(`Success::>${_result.data}`); }).catch(_error => { console.error(`Failure::>${_error.reason}`); }); diff --git a/procentric/application/lib/hoteltv.hcap.js b/procentric/application/lib/hoteltv.hcap.js index 639b354..106f63d 100755 --- a/procentric/application/lib/hoteltv.hcap.js +++ b/procentric/application/lib/hoteltv.hcap.js @@ -38,7 +38,7 @@ HotelTV.hcap = (function() { 'input_splash_image', 'block_usb', 'tv_channel_attribute_floating_ui', 'instant_power', 'hardware_version', 'network_info', - 'tv_channel_ui', + 'tv_channel_ui', "mute_on_tv_input", 'soft_ap_ui', "soft_ap", "soft_ap_password", 'end_of_item' ]; @@ -1045,6 +1045,13 @@ HotelTV.hcap = (function() { } } + // MUTE ON TV INPUT: Prevent TV channel auto play when exit OTT + if (_devinfo["mute_on_tv_input"] !== undefined) { + if (_devinfo["mute_on_tv_input"] != 1) { + _pmFxnArProperty.push(__hcapfxn_set_property('mute_on_tv_input', 1)); + } + } + // // OSD LAYER ID // if (_devinfo["osd_layer_id"] !== undefined) { // if (_devinfo["osd_layer_id"] != 0) { @@ -1551,6 +1558,21 @@ HotelTV.hcap = (function() { }, + // _type은 hcap.externalinput.ExternalInputType형이고, 현재는 HDMI로 고정 + // _index는 HDMI포트 번호 + SetExternalInput: function(_type, _index) { + hcap.externalinput.setCurrentExternalInput({ + "type" : hcap.externalinput.ExternalInputType.HDMI, + "index" : _index, + "onSuccess" : function() { + console.log("onSuccess"); + }, + "onFailure" : function(f) { + console.error("onFailure : errorMessage = " + f.errorMessage); + } + }); + }, + Test: function() { console.log("Test Start...."); diff --git a/procentric/application/lib/hoteltv.js b/procentric/application/lib/hoteltv.js index 2e1a67d..bc43bab 100755 --- a/procentric/application/lib/hoteltv.js +++ b/procentric/application/lib/hoteltv.js @@ -29,7 +29,10 @@ var HotelTV = HotelTV || { 'state': { 'lang': 'kr', 'menu': { - 'stage': null, + 'stage': { + 'cur':null, + 'prev':null, + }, 'main': { 'cnt': 0, 'cur': null, @@ -45,9 +48,16 @@ var HotelTV = HotelTV || { 'media': { 'playing': false, }, + 'tv':{ + 'playing': false, + }, 'hotkey': { "mm": {} }, + 'schedule': { + 'flight_reflash': false, + 'weather_reflash': false + }, 'token': null }, 'carts': { @@ -163,6 +173,7 @@ function __fxn_Set_DebugOpt() { HotelTV.Init = async function() { console.log("Start Initialization:: "); + //STEP#01::> Shutdown Channel HotelTV.hcap.ChannelShutDown(); @@ -460,8 +471,6 @@ HotelTV.LoadWelCome = async function() { console.error("Display Error page for get translation info"); } - - //Set checkined guest language HotelTV.state.lang = HotelTV.guestinfo.language; @@ -470,11 +479,92 @@ HotelTV.LoadWelCome = async function() { //await HotelTV.hcap.ShowDevInfo(); HotelTV.ui_welcome.Show(); + + + //STEP#06 Register Service web worker + if (window.SharedWorker) { + const myWorker = new SharedWorker("./lib/hoteltv.service.js"); + + myWorker.port.postMessage({ + 'cmd': "start_service", + "param": { + "token": HotelTV.state.token, + "dev_family": HotelTV.devinfo.model_name.substring(2, HotelTV.devinfo.model_name.length - 1), + "dev_snum": HotelTV.devinfo.serial_number, + "svrinfo": HotelTV.svrinfo, + }, + }); + + + myWorker.port.onmessage = function(e) { + let recvMsg = e.data; + //console.log(`Recv Msg[${recvMsg.event}]::> ${recvMsg.ret} ::> ${recvMsg.data}`); + //console.log(`Recv Msg[${recvMsg.event}]::> ${recvMsg.ret}`); + if (recvMsg.event == "update_report") { + HotelTV.hcap.GetUptime(); + HotelTV.hcap.GetDeviceUsage().then(_usage => { + //console.log(`USAGE::> CPU[${_usage.cpu}%]`); + HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage); + }); + } + } + } else { + console.error('Your browser doesn\'t support web workers.') + } + + //STEP#07 MQTT Service + if (HotelTV.services) { + if (HotelTV.services.mqtt) { + let _mqttSvcInfo = HotelTV.services.mqtt; + + if (_mqttSvcInfo.protocol == "ws") { + HotelTV.services.client = mqtt.connect( + //'ws://' + HotelTV.svrinfo.ipaddr + ':9001', + 'ws://' + _mqttSvcInfo.host + ':' + _mqttSvcInfo.port, { + clean: true, // retain session + connectTimeout: 4000, // Timeout period + username: _mqttSvcInfo.username, + password: _mqttSvcInfo.password, + clientId: 'mqtt_sid_' + HotelTV.devinfo.serial_number.substring(0, 12) + } + ); + + HotelTV.services.client.on('connect', function() { + HotelTV.services.client.subscribe(_mqttSvcInfo.topic, function(err) { + if (err) { + console.error(`Fail to subscribe::TOPIC[${_mqttSvcInfo.topic}]`); + } else { + console.log(`Success to subscribe::TOPIC[${_mqttSvcInfo.topic}]`); + } + }); + }) + + HotelTV.services.client.on('message', function(topic, message) { + let szMsg = message.toString(); + HotelTV.ui_welcome.MqttEvent(szMsg); + //MQTT메시지 종료 하려면 아래 end호출 + //HotelTV.services.client.end() + }) + + HotelTV.services.client.on('error', function(error) { + // message is Buffer + console.error(error.toString()); + //HotelTV.services.client.end() + }) + } + } + } } HotelTV.UnloadWelCome = async function() { sessionStorage.setItem("state", JSON.stringify(HotelTV.state)); HotelTV.ui_welcome.Close(); + + //MQTT Disconnect + if( HotelTV.services.client ){ + HotelTV.services.client.end(); + } + if (HotelTV.state['registration'].license == 'hotel-full') { setTimeout(function() { window.location.replace('./app_hoteltv_full.html'); @@ -484,6 +574,9 @@ HotelTV.UnloadWelCome = async function() { HotelTV.LoadAppFull = async function() { + //Turn Off HCAP api log + extDisableHcapConsoleLog = true; + HotelTV.ui_utils.SetBusy(true); //STEP#01: Load session info @@ -516,8 +609,8 @@ HotelTV.LoadAppFull = async function() { console.error("Display Error page for get amenity carts info"); } + HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts(); try { - HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts(); } catch (_error) { console.error("Display Error page for get roomservicec carts info"); } @@ -618,7 +711,9 @@ HotelTV.LoadAppFull = async function() { HotelTV.flight =recvMsg.data; } } else if (recvMsg.event == "update_weather") { - // + if (recvMsg.ret === "OK") { + HotelTV.weather =recvMsg.data; + } } else if (recvMsg.event == "update_report") { HotelTV.hcap.GetUptime(); HotelTV.hcap.GetDeviceUsage().then(_usage => { @@ -626,6 +721,9 @@ HotelTV.LoadAppFull = async function() { HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage); }); } + + // BGServiceEvent function for post processing + HotelTV.ui_appfull.BGServiceEvent(recvMsg.event); } } else { console.error('Your browser doesn\'t support web workers.') @@ -637,7 +735,7 @@ HotelTV.LoadAppFull = async function() { let _mqttSvcInfo = HotelTV.services.mqtt; if (_mqttSvcInfo.protocol == "ws") { - var client = mqtt.connect( + HotelTV.services.client = mqtt.connect( //'ws://' + HotelTV.svrinfo.ipaddr + ':9001', 'ws://' + _mqttSvcInfo.host + ':' + _mqttSvcInfo.port, { clean: true, // retain session @@ -648,8 +746,8 @@ HotelTV.LoadAppFull = async function() { } ); - client.on('connect', function() { - client.subscribe(_mqttSvcInfo.topic, function(err) { + HotelTV.services.client.on('connect', function() { + HotelTV.services.client.subscribe(_mqttSvcInfo.topic, function(err) { if (err) { console.error(`Fail to subscribe::TOPIC[${_mqttSvcInfo.topic}]`); } else { @@ -658,17 +756,17 @@ HotelTV.LoadAppFull = async function() { }); }) - client.on('message', function(topic, message) { + HotelTV.services.client.on('message', function(topic, message) { let szMsg = message.toString(); HotelTV.ui_appfull.MqttEvent(szMsg); //MQTT메시지 종료 하려면 아래 end호출 - //client.end() + //HotelTV.services.client.end() }) - client.on('error', function(error) { + HotelTV.services.client.on('error', function(error) { // message is Buffer console.error(error.toString()); - //client.end() + //HotelTV.services.client.end() }) } } @@ -676,11 +774,14 @@ HotelTV.LoadAppFull = async function() { // - HotelTV.hcap.Test(); + //HotelTV.hcap.Test(); } HotelTV.UnloadAppFull = async function() { - + //MQTT Disconnect + if( HotelTV.services.client ){ + HotelTV.services.client.end(); + } } diff --git a/procentric/application/lib/hoteltv.service.js b/procentric/application/lib/hoteltv.service.js index 68635fc..4608d14 100755 --- a/procentric/application/lib/hoteltv.service.js +++ b/procentric/application/lib/hoteltv.service.js @@ -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) { diff --git a/procentric/application/lib/hoteltv.ui_appfull.js b/procentric/application/lib/hoteltv.ui_appfull.js index 8ff7ecf..3c3d516 100755 --- a/procentric/application/lib/hoteltv.ui_appfull.js +++ b/procentric/application/lib/hoteltv.ui_appfull.js @@ -76,7 +76,7 @@ HotelTV.ui_appfull = (function() { console.log("media_event_received = " + _evt.eventType); let _stateMedia = _evt.eventType; - if (_state.menu.stage == "ctzgen") { + if (_state.menu.stage.cur == "ctzgen") { switch (_stateMedia) { case 'play_start': _state.media.playing = true; @@ -155,9 +155,6 @@ HotelTV.ui_appfull = (function() { // HotelTV.hcap.SetSoftAp({ // "enable": false, // }); - // 현재 재생중인 TV채널 종료 - console.log("Try to channel shutdown.."); - HotelTV.hcap.ChannelShutDown(); }else if (_typeAppFocusEvt == "unfocused") { } @@ -169,14 +166,51 @@ HotelTV.ui_appfull = (function() { */ function __uifxn_AppFull_OnHdmiConChangeEvt(_evt) { let _state = HotelTV.state; + let _trTbl = HotelTV.translation; // {Number} param.index - index of the HDMI which was connected or disconnected. // {Boolean} param.connected - true if the HDMI is connected, else false. - console.log( + console.warn( "Event 'hdmi_connection_changed' is received.\n" + - "HDMI-" + param.index + " : " + "connected = " + param.connected + "HDMI-" + _evt.index + " : " + "connected = " + _evt.connected + ); + + if ( _evt.connected==true ){ + _state.menu.stage.prev = _state.menu.stage.cur; + _state.menu.stage.cur = "external_av_hdmi"; + setTimeout(function(){ + $('body,html').fadeOut(500, function(){ + HotelTV.hcap.SetExternalInput("HDMI", Number(_evt.index)-1); + }); + }, 1000); + HotelTV.ui_utils.ShowNotificationMsgBalloon(_trTbl.system.notice.event.external_input.hdmi_connected[_state.lang], 5); + }else{ + $('body,html').fadeIn(500); + _state.menu.stage.cur = _state.menu.stage.prev; + _state.menu.stage.prev = null; + } + } + + /** + * HotelTV UI Wrapper Function::> received event handling function + * @param {dictionary} _evt event information + */ + function __uifxn_AppFull_OnTvChChgChangeEvt(_evt) { + let _state = HotelTV.state; + + // Set tv playing flag + _state.tv.playing = true; + // {Boolean} param.result - true if the current channel is changed successfully, else false. + // {String} param.errorMessage - in case of failure, this message provides the details. + console.log( + "Event 'channel_changed' is received.\n" + + "Result = " + _evt.result + "\n" + + "Error message = " + _evt.errorMessage ); } + + + /** * HotelTV UI[AppFull] Wrapper Function::> show/hide special hotkey(red/yellow/green/blue/etc...) btn * @param {boolean} e event @@ -2382,12 +2416,12 @@ HotelTV.ui_appfull = (function() { el_width = (el_width + 100) * -1; if ($('.main .tv .bg .owl-carousel .owl-stage-outer').position().left == el_width) { $('.main .tv .bg .owl-carousel .owl-stage-outer').stop().animate({ left: '0px' }, 800, function() { - _state.menu.stage = "tvCtgShow"; + _state.menu.stage.cur = "tvCtgShow"; }); } } else { if ($('.main .tv .bg .owl-carousel .owl-stage-outer').position().left == 0) { - _state.menu.stage = "tvCtgHide"; + _state.menu.stage.cur = "tvCtgHide"; let el_width = $('.main .tv .bg .owl-carousel .owl-stage-outer .owl-stage .item').width(); el_width = (el_width + 100) * -1; $('.main .tv .bg .owl-carousel .owl-stage-outer').stop().animate({ left: el_width.toString() + 'px' }, 800); @@ -2477,7 +2511,7 @@ HotelTV.ui_appfull = (function() { } // 초기 메인 메뉴 KEY설정 - _state.menu.stage = "preparing_mypage"; + _state.menu.stage.cur = "preparing_mypage"; if (_state.menu.main[_mmIdx].cur == null) { _state.menu.main[_mmIdx].cur = Object.keys(_mpinfo)[0]; } @@ -2711,7 +2745,7 @@ HotelTV.ui_appfull = (function() { $('#lst_mypagesel').trigger('translate.owl.carousel', [0]); $(document.activeElement).keydown(function(event) { //attach event listener - if (_state.menu.stage == "mypage") { + if (_state.menu.stage.cur == "mypage") { if (event.keyCode == gRmtKey.left) { $('#lst_mypagesel').trigger('prev.owl') $('#lst_mypagebg').trigger('prev.owl') @@ -2772,7 +2806,7 @@ HotelTV.ui_appfull = (function() { //SHOW ANIMATION if ($('.popup>.mypage>.message').css('display') == "none") { - _state.menu.stage = "popup_message_card"; + _state.menu.stage.cur = "popup_message_card"; $('.main>.mypage>.slider').animate({ top: 1080, left: 0 }, 1000, function() { $('.popup>.mypage>.message').fadeIn(500); @@ -2801,7 +2835,7 @@ HotelTV.ui_appfull = (function() { $('.main .mypage').hide(); _hndl_mpSel = null; _hndl_mpBg = null; - _state.menu.stage = "main" + _state.menu.stage.cur = "main" setTimeout(function() { __uifxn_AppFull_ShowMMHotKeyBtn(true); }, 500); @@ -2809,11 +2843,11 @@ HotelTV.ui_appfull = (function() { } else { console.log("MYPAGE KEYEVT: Skip events::>" + event.keyCode); } - } else if (_state.menu.stage == "popup_message_card") { + } else if (_state.menu.stage.cur == "popup_message_card") { if (event.keyCode == gRmtKey.back) { if ($('.popup>.mypage>.message').css('display') != "none") { $('.popup>.mypage>.message').fadeOut(500, function() { - _state.menu.stage = "mypage"; + _state.menu.stage.cur = "mypage"; $('.main>.mypage>.slider').animate({ top: 864, left: 0 }, 1000) }); } @@ -2821,10 +2855,10 @@ HotelTV.ui_appfull = (function() { console.log("POPUP MESSAGE CARD KEYEVT: Skip events::>" + event.keyCode); } } else { - console.log("INVALID MYPAGE SUBMENU STAGE::>" + _state.menu.stage); + console.log("INVALID MYPAGE SUBMENU STAGE::>" + _state.menu.stage.cur); } }); - _state.menu.stage = "mypage"; + _state.menu.stage.cur = "mypage"; }); $('#lst_mypagesel').on('translate.owl.carousel', function(event) { @@ -2996,7 +3030,7 @@ HotelTV.ui_appfull = (function() { _el_target.each(function(index, item) { $($(item).children()[tv_chElIdx]).addClass("focused"); }); - _state.menu.stage = "tvCtgShow"; + _state.menu.stage.cur = "tvCtgShow"; console.log("1st time ...."); } } else if (_action == "ch_up") { @@ -3079,7 +3113,7 @@ HotelTV.ui_appfull = (function() { } // UI State Flag 설정 - _state.menu.stage = "preparing_ctz_general"; + _state.menu.stage.cur = "preparing_ctz_general"; if (_state.menu.main[_mmIdx][_smIdx].cur == null) { _state.menu.main[_mmIdx][_smIdx].cur = Object.keys(_ctzinfo)[0]; } @@ -3145,6 +3179,24 @@ HotelTV.ui_appfull = (function() { _div_ctz_item.appendChild(_div_ctz_frame); + + // 나중에 구현하기로 하고 조선프로젝트에서 우선 스킵 + // // 컨텐트 IMAGE VIEWER DIV 삽입 + // let _div_ctz_imgvwr = document.createElement('div'); + // _div_ctz_imgvwr.setAttribute("class", "ctz_imgvwr_frame"); + // _div_ctz_item.appendChild(_div_ctz_imgvwr); + + // // 이미지 뷰어를 사용하는 경우 경우, PLAY안내 버튼 노출 + // if (_ctzinfo[_ctzidx].images.enable == true && _ctzinfo[_ctzidx].images.files[_state.lang]) { + // let _div_ctz_vwrctrl = document.createElement('div'); + // _div_ctz_vwrctrl.setAttribute("class", "ctz_mv_ctrl"); + // // _div_ctz_vwrctrl.setAttribute("video_url", _ctzinfo[_ctzidx].video.files[_state.lang].download); + // _sz_styleOpt = '--playmsg: "' + _trTbl.ui.player.watch_imgshow[_state.lang] + '";'; + // _sz_styleOpt += '--stopmsg: "' + _trTbl.ui.player.stop_imgshow[_state.lang] + '";'; + // _div_ctz_vwrctrl.setAttribute("style", _sz_styleOpt); + // _div_ctz_item.appendChild(_div_ctz_vwrctrl); + // } + // 동영상이 있는 경우, PLAY안내 버튼 노출 if (_ctzinfo[_ctzidx].video.enable == true && _ctzinfo[_ctzidx].video.files[_state.lang]) { let _div_ctz_mvctrl = document.createElement('div'); @@ -3181,7 +3233,7 @@ HotelTV.ui_appfull = (function() { $('.main .sub').fadeOut(600); //$('#lst_ctzgenbg').trigger('translate.owl.carousel', [0]); $('#lst_ctzgenbg').trigger('translate.owl.carousel', [0, 500, true]); - _state.menu.stage = "ctzgen"; + _state.menu.stage.cur = "ctzgen"; }); }); }); @@ -3290,7 +3342,7 @@ HotelTV.ui_appfull = (function() { } // 초기 메인 메뉴 KEY설정 - _state.menu.stage = "preparing_sub"; + _state.menu.stage.cur = "preparing_sub"; if (_state.menu.main[_mmIdx].cur == null) { _state.menu.main[_mmIdx].cur = Object.keys(_sminfo)[0]; } @@ -3426,7 +3478,7 @@ HotelTV.ui_appfull = (function() { $('#lst_smsel').trigger('translate.owl.carousel', [0, 500, true]); $(document.activeElement).keydown(function(event) { //attach event listener - if (_state.menu.stage == "sub") { + if (_state.menu.stage.cur == "sub") { if (event.keyCode == gRmtKey.left) { $('#lst_smsel').trigger('prev.owl', 700); } else if (event.keyCode == gRmtKey.right) { @@ -3478,13 +3530,13 @@ HotelTV.ui_appfull = (function() { $('.main .sub').hide(); _hndl_smSel = null; _hndl_smBg = null; - _state.menu.stage = "main" + _state.menu.stage.cur = "main" setTimeout(function() { __uifxn_AppFull_ShowMMHotKeyBtn(true); }, 500); }); } - } else if (_state.menu.stage == "ctzgen") { + } else if (_state.menu.stage.cur == "ctzgen") { if (event.keyCode == gRmtKey.left) { $('#lst_ctzgenbg').trigger('prev.owl', 700); } else if (event.keyCode == gRmtKey.right) { @@ -3503,7 +3555,7 @@ HotelTV.ui_appfull = (function() { $('#lst_ctzgenbg').owlCarousel('destroy'); $('.main .ctzgen .bg #lst_ctzgenbg div').remove(); _hndl_ctzGenBg = null; - _state.menu.stage = "sub"; + _state.menu.stage.cur = "sub"; $('#lst_smsel').trigger('translate.owl.carousel', [0]); }); } else if (event.keyCode == gRmtKey.start) { @@ -3544,7 +3596,7 @@ HotelTV.ui_appfull = (function() { console.log("SUBMENU KEYEVT: Skip events"); } }); - _state.menu.stage = "sub"; + _state.menu.stage.cur = "sub"; }); }); @@ -3606,7 +3658,7 @@ HotelTV.ui_appfull = (function() { } // 초기 메인 메뉴 KEY설정 - _state.menu.stage = "preparing_tv"; + _state.menu.stage.cur = "preparing_tv"; if (_state.menu.main[_mmIdx].cur == null) { _state.menu.main[_mmIdx].cur = Object.keys(_tvProg)[0]; @@ -3741,7 +3793,7 @@ HotelTV.ui_appfull = (function() { $('#lst_tvCtgbg').trigger('translated.owl.carousel', [0]); $(document.activeElement).keydown(function(event) { //attach event listener - if (_state.menu.stage == "tvCtgShow") { + if (_state.menu.stage.cur == "tvCtgShow") { if (event.keyCode == gRmtKey.left) { $('#lst_tvCtgbg').trigger('prev.owl', [1000]) } else if (event.keyCode == gRmtKey.right) { @@ -3799,7 +3851,7 @@ HotelTV.ui_appfull = (function() { $('.main .tv .bg #lst_tvCtgbg div').remove(); _hndl_tvCtg = null; - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; setTimeout(function() { __uifxn_AppFull_ShowMMHotKeyBtn(true); @@ -3807,7 +3859,7 @@ HotelTV.ui_appfull = (function() { }, 500); }); } - } else if (_state.menu.stage == "tvCtgHide") { + } else if (_state.menu.stage.cur == "tvCtgHide") { if (event.keyCode == 427) { // 채널 리스트 아이탬 이동(UP) let _mmIdx = _state.menu.main.cur; @@ -3858,7 +3910,7 @@ HotelTV.ui_appfull = (function() { $('.main .tv .bg #lst_tvCtgbg div').remove(); _hndl_tvCtg = null; - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; setTimeout(function() { __uifxn_AppFull_ShowMMHotKeyBtn(true); @@ -3869,7 +3921,7 @@ HotelTV.ui_appfull = (function() { console.log("event.keyCode::>" + event.keyCode); } } else { - console.log("TVMENU KEYEVT: Skip events::> Invalid menu stage:" + _state.menu.stage); + console.log("TVMENU KEYEVT: Skip events::> Invalid menu stage:" + _state.menu.stage.cur); } }); }); @@ -3933,7 +3985,7 @@ HotelTV.ui_appfull = (function() { //console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt} TMDiff::> ${_tm_diff_ms}`); // - if (_state.menu.stage == "popup_message_card") { + if (_state.menu.stage.cur == "popup_message_card") { //HIDE NEWS and USER GUIDE TIPS if (_newsInfo == null || _newsInfo.length == 0) { if ($('.news').css('display') != "none") { @@ -3945,7 +3997,7 @@ HotelTV.ui_appfull = (function() { $('.guide>.tips').fadeOut(500); } return; - } else if (_state.menu.stage == "tvCtgHide") { + } else if (_state.menu.stage.cur == "tvCtgHide") { //HIDE NEWS and USER GUIDE TIPS if (_newsInfo == null || _newsInfo.length == 0) { if ($('.news').css('display') != "none") { @@ -3964,8 +4016,8 @@ HotelTV.ui_appfull = (function() { //SHOW USER GUIDE TIPS let show_stages = ["hotkey_mm_red", "hotkey_mm_green", "hotkey_mm_yellow", "hotkey_mm_blue", "main", "sub", "ctzgen", "tvCtgShow", "mypage"]; let sz_msg = null; - if (show_stages.includes(_state.menu.stage) == true) { - switch (_state.menu.stage) { + if (show_stages.includes(_state.menu.stage.cur) == true) { + switch (_state.menu.stage.cur) { case "hotkey_mm_red": sz_msg = _trTbl.ui.guide.navi_brochure[_state.lang]; if ($('.guide>.tips').text() != sz_msg) { @@ -4161,7 +4213,7 @@ HotelTV.ui_appfull = (function() { } } else { $('.main .mm .flight').each(function (index, docObjFlight) { - console.log(index); + //console.log(index); if ( $(docObjFlight).css("display")!="none" ){ if ( $(docObjFlight).find('#record').length>0 ){ $(docObjFlight).find('#record').scrollTop(0); @@ -4451,137 +4503,6 @@ HotelTV.ui_appfull = (function() { $(`.main .mm #flight_${_program[_mm_idx].location} #caution`).text(_trTbl.ui.flight.caution.body[_state.lang]); } } - - // let _elWeatherToday = _elWeatherRoot.children('.today'); - // let _elWeatherForcast = _elWeatherRoot.children('.forcast'); - // let _elWeatherCation = _elWeatherRoot.children('#caution'); - - - // $('.main .mm .flight .departure #title').text(_trTbl.ui.flight.title.departure[_state.lang]); - // $('.main .mm .flight .arrival #title').text(_trTbl.ui.flight.title.arrival[_state.lang]); - - // let _tblHdr = $('.main .mm .flight table th') - // for (let _i = 0; _i < _tblHdr.length; ++_i) { - // if (_tblHdr[_i].id == "airline") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.airline[_state.lang]; - // } else if (_tblHdr[_i].id == "flight") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.flight_no[_state.lang]; - // } else if (_tblHdr[_i].id == "scheduled") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.scheduled[_state.lang]; - // } else if (_tblHdr[_i].id == "origin") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.origin[_state.lang]; - // } else if (_tblHdr[_i].id == "destination") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.destination[_state.lang]; - // } else if (_tblHdr[_i].id == "type") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.classification[_state.lang]; - // } else if (_tblHdr[_i].id == "gate") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.title.boarding_gate[_state.lang]; - // } else if (_tblHdr[_i].id == "status") { - // _tblHdr[_i].innerText = _trTbl.ui.flight.status[_state.lang]; - // } - // } - - // //Delete all table record for departure & arrival - // let _el_departure_tbl_rec = document.querySelector('.main .mm .flight .departure table #record'); - // let _el_arrival_tbl_rec = document.querySelector('.main .mm .flight .arrival table #record'); - - // //Delete all table record for departure & arrival - // $('.main .mm .flight .departure table tr#record').remove(); - // $('.main .mm .flight .arrival table tr#record').remove(); - - // for (let _i = 0; _i < _flight.count; _i++) { - // let _schOrg = new Date(); - // let _schEdt = new Date(); - // let _flitem = _flight.items[_i]; - - // //let _sTmOrg = _flitem.std.length != 4 ? null : ; - // //let _sTmChanged = _flitem.etd; - - // if (_flitem.std.length != 4) { - // console.log("Flight Schedule org time is NULL"); - // } else { - // _schOrg.setHours(Number(_flitem.std.charAt(0) + _flitem.std.charAt(1))); - // _schOrg.setMinutes(Number(_flitem.std.charAt(2) + _flitem.std.charAt(3))); - // } - - // if (_flitem.std.length != 4) { - // console.log("Flight Schedule edited time is NULL"); - // } else { - // _schEdt.setHours(Number(_flitem.std.charAt(0) + _flitem.std.charAt(1))); - // _schEdt.setMinutes(Number(_flitem.std.charAt(2) + _flitem.std.charAt(3))); - // } - - - - // let diffMs = (_schOrg - _curDaTm); // milliseconds between now & Christmas - // // let diffDays = Math.floor(diffMs / 86400000); // days - // // let diffHrs = Math.floor((diffMs % 86400000) / 3600000); // hours - // // let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes - // // console.log(diffDays + " days, " + diffHrs + " hours, " + diffMins + " minutes"); - // let diffMins = Math.round(diffMs / 60000); - // //console.log("TDiff::> " + diffMins); - - // if ((-60 < diffMins) && (diffMins < 120)) { - // if (_flitem.io == "O") { - // let _el_tr = document.createElement('tr'); - // _el_tr.setAttribute("id", "record"); - // ar_tdItem.forEach(_itm => { - // let _el_td = document.createElement('td'); - // _el_td.setAttribute("id", _itm); - // if (_itm == "airline") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airline(_trTbl.ui.flight.airlines, _flitem.airline, _state.lang); - // } else if (_itm == "flight") { - // _el_td.innerText = _flitem.airFln; - // } else if (_itm == "scheduled") { - // _el_td.innerText = _flitem.std.charAt(0) + _flitem.std.charAt(1) + ":" + _flitem.std.charAt(2) + _flitem.std.charAt(3) + " - "; - // _el_td.innerText += _flitem.etd.charAt(0) + _flitem.etd.charAt(1) + ":" + _flitem.etd.charAt(2) + _flitem.etd.charAt(3); - // } else if (_itm == "origin") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.boarding, _state.lang); - // } else if (_itm == "destination") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.arrived, _state.lang); - // } else if (_itm == "type") { - // _el_td.innerText = _trTbl.ui.flight.line[_flitem.line][_state.lang]; - // } else if (_itm == "gate") { - // _el_td.innerText = _flitem.gate; - // } else if (_itm == "status") { - // _el_td.innerText = HotelTV.ui_utils.Get_FlightStatus(_trTbl.ui.flight.result, _flitem.rmk, _state.lang); - // } - // _el_tr.appendChild(_el_td); - // }); - // _el_departure_tbl_rec.appendChild(_el_tr); - // } else { - // let _el_tr = document.createElement('tr'); - // _el_tr.setAttribute("id", "record"); - // ar_tdItem.forEach(_itm => { - // let _el_td = document.createElement('td'); - // _el_td.setAttribute("id", _itm); - // if (_itm == "airline") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airline(_trTbl.ui.flight.airlines, _flitem.airline, _state.lang); - // } else if (_itm == "flight") { - // _el_td.innerText = _flitem.airFln; - // } else if (_itm == "scheduled") { - // _el_td.innerText = _flitem.std.charAt(0) + _flitem.std.charAt(1) + ":" + _flitem.std.charAt(2) + _flitem.std.charAt(3) + " - "; - // _el_td.innerText += _flitem.etd.charAt(0) + _flitem.etd.charAt(1) + ":" + _flitem.etd.charAt(2) + _flitem.etd.charAt(3); - // } else if (_itm == "origin") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.boarding, _state.lang); - // } else if (_itm == "destination") { - // _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.arrived, _state.lang); - // } else if (_itm == "type") { - // if (_trTbl.ui.flight.line[_flitem.line]) { - // _el_td.innerText = _trTbl.ui.flight.line[_flitem.line][_state.lang]; - // } - // } else if (_itm == "gate") { - // _el_td.innerText = _flitem.gate; - // } else if (_itm == "status") { - // _el_td.innerText = HotelTV.ui_utils.Get_FlightStatus(_trTbl.ui.flight.result, _flitem.rmk, _state.lang); - // } - // _el_tr.appendChild(_el_td); - // }); - // _el_arrival_tbl_rec.appendChild(_el_tr); - // } - // } - // } - // $('.main .mm .flight #caution').text(_trTbl.ui.flight.caution.body[_state.lang]); } /** @@ -4660,7 +4581,7 @@ HotelTV.ui_appfull = (function() { _mm_width = 266; // 초기 메인 메뉴 KEY설정 - _state.menu.stage = "preparing_main"; + _state.menu.stage.cur = "preparing_main"; if (_state.menu.main.cur == null) { _state.menu.main.cur = Object.keys(_program)[0]; } @@ -4817,16 +4738,23 @@ HotelTV.ui_appfull = (function() { $('#lst_mmsel').trigger('translate.owl.carousel', [0, 500, true]); HotelTV.ui_utils.SetBusy(false); - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; }); $(document).on('keydown', function(_evt) { //attach event listener let _opening = HotelTV.opening; let _trTbl = HotelTV.translation; - if (_state.menu.stage == "main") { + if (_state.menu.stage.cur == "main") { console.log(`MM KEY EVENT::> ${_evt.keyCode}, UINT=>${parseInt(_evt.keyCode)}`); + // 현재 재생중인 TV채널 종료 + if ( _state.tv.playing == true ){ + console.warn("Try to channel shutdown.."); + HotelTV.hcap.ChannelShutDown(); + _state.tv.playing = false; + } + if (_evt.keyCode == gRmtKey.left) { $('#lst_mmsel').trigger('prev.owl', 700) //console.log(" MM ID::> " + _state.menu.main.cur + _program[_state.menu.main.cur].name); @@ -4887,14 +4815,14 @@ HotelTV.ui_appfull = (function() { $('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() { if (_state.hotkey.mm.red.type == "brochure") { $('.popup .hotkey_mm_red').fadeIn(1000, function() { - _state.menu.stage = "hotkey_mm_red"; + _state.menu.stage.cur = "hotkey_mm_red"; __uifxn_AppFull_ShowMMHotKeyBtn(false); __uifxn_AppFull_TopWidjetShow(false); }); } else if (_state.hotkey.mm.red.type == "amenity") { $('.popup .amenity').show(0, function() { $('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_amenity"; + _state.menu.stage.cur = "hotkey_mm_amenity"; __uifxn_AppFull_DrawAmenityItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4902,7 +4830,7 @@ HotelTV.ui_appfull = (function() { } else if (_state.hotkey.mm.red.type == "roomservice") { $('.popup .roomservice').show(0, function() { $('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_roomservice"; + _state.menu.stage.cur = "hotkey_mm_roomservice"; __uifxn_AppFull_DrawRoomserviceItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4917,14 +4845,14 @@ HotelTV.ui_appfull = (function() { $('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() { if (_state.hotkey.mm.green.type == "brochure") { $('.popup .hotkey_mm_green').fadeIn(1000, function() { - _state.menu.stage = "hotkey_mm_green"; + _state.menu.stage.cur = "hotkey_mm_green"; __uifxn_AppFull_ShowMMHotKeyBtn(false); __uifxn_AppFull_TopWidjetShow(false); }); } else if (_state.hotkey.mm.green.type == "amenity") { $('.popup .amenity').show(0, function() { $('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_amenity"; + _state.menu.stage.cur = "hotkey_mm_amenity"; __uifxn_AppFull_DrawAmenityItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4932,7 +4860,7 @@ HotelTV.ui_appfull = (function() { } else if (_state.hotkey.mm.green.type == "roomservice") { $('.popup .roomservice').show(0, function() { $('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_roomservice"; + _state.menu.stage.cur = "hotkey_mm_roomservice"; __uifxn_AppFull_DrawRoomserviceItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4947,14 +4875,14 @@ HotelTV.ui_appfull = (function() { $('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() { if (_state.hotkey.mm.yellow.type == "brochure") { $('.popup .hotkey_mm_yellow').fadeIn(1000, function() { - _state.menu.stage = "hotkey_mm_yellow"; + _state.menu.stage.cur = "hotkey_mm_yellow"; __uifxn_AppFull_ShowMMHotKeyBtn(false); __uifxn_AppFull_TopWidjetShow(false); }); } else if (_state.hotkey.mm.yellow.type == "amenity") { $('.popup .amenity').show(0, function() { $('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_amenity"; + _state.menu.stage.cur = "hotkey_mm_amenity"; __uifxn_AppFull_DrawAmenityItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4962,7 +4890,7 @@ HotelTV.ui_appfull = (function() { } else if (_state.hotkey.mm.yellow.type == "roomservice") { $('.popup .roomservice').show(0, function() { $('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_roomservice"; + _state.menu.stage.cur = "hotkey_mm_roomservice"; __uifxn_AppFull_DrawRoomserviceItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4977,14 +4905,14 @@ HotelTV.ui_appfull = (function() { $('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() { if (_state.hotkey.mm.blue.type == "brochure") { $('.popup .hotkey_mm_blue').fadeIn(1000, function() { - _state.menu.stage = "hotkey_mm_blue"; + _state.menu.stage.cur = "hotkey_mm_blue"; __uifxn_AppFull_ShowMMHotKeyBtn(false); __uifxn_AppFull_TopWidjetShow(false); }); } else if (_state.hotkey.mm.blue.type == "amenity") { $('.popup .amenity').show(0, function() { $('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_amenity"; + _state.menu.stage.cur = "hotkey_mm_amenity"; __uifxn_AppFull_DrawAmenityItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -4992,7 +4920,7 @@ HotelTV.ui_appfull = (function() { } else if (_state.hotkey.mm.blue.type == "roomservice") { $('.popup .roomservice').show(0, function() { $('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_roomservice"; + _state.menu.stage.cur = "hotkey_mm_roomservice"; __uifxn_AppFull_DrawRoomserviceItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -5007,7 +4935,7 @@ HotelTV.ui_appfull = (function() { if (_opening.amenity) { $('.popup .amenity').show(0, function() { $('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_amenity"; + _state.menu.stage.cur = "hotkey_mm_amenity"; __uifxn_AppFull_DrawAmenityItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -5020,7 +4948,7 @@ HotelTV.ui_appfull = (function() { if (_opening.roomService) { $('.popup .roomservice').show(0, function() { $('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => { - _state.menu.stage = "hotkey_mm_roomservice"; + _state.menu.stage.cur = "hotkey_mm_roomservice"; __uifxn_AppFull_DrawRoomserviceItem(true); __uifxn_AppFull_ShowMMHotKeyBtn(false); }); @@ -5049,7 +4977,7 @@ HotelTV.ui_appfull = (function() { HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':_state['specialKey']['tv'].id}}]) } } - } else if (_state.menu.stage == "hotkey_mm_red") { + } else if (_state.menu.stage.cur == "hotkey_mm_red") { console.log("HOTKEY(MM:RED) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { $('#lst_hotkey_mm_red').trigger('prev.owl') @@ -5059,13 +4987,13 @@ HotelTV.ui_appfull = (function() { $('.popup .hotkey_mm_red').fadeOut(1000, function() { $('.popup .hotkey_mm_red').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() { $('.popup .hotkey_mm_red').css({ "background-color": "" }); - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); __uifxn_AppFull_TopWidjetShow(true); }); }); } - } else if (_state.menu.stage == "hotkey_mm_green") { + } else if (_state.menu.stage.cur == "hotkey_mm_green") { console.log("HOTKEY(MM:GREEN) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { $('#lst_hotkey_mm_green').trigger('prev.owl') @@ -5075,13 +5003,13 @@ HotelTV.ui_appfull = (function() { $('.popup .hotkey_mm_green').fadeOut(1000, function() { $('.popup .hotkey_mm_green').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() { $('.popup .hotkey_mm_green').css({ "background-color": "" }); - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); __uifxn_AppFull_TopWidjetShow(true); }); }); } - } else if (_state.menu.stage == "hotkey_mm_yellow") { + } else if (_state.menu.stage.cur == "hotkey_mm_yellow") { console.log("HOTKEY(MM:YELLOW) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { console.log("LEFT"); @@ -5095,13 +5023,13 @@ HotelTV.ui_appfull = (function() { $('.popup .hotkey_mm_yellow').fadeOut(1000, function() { $('.popup .hotkey_mm_yellow').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() { $('.popup .hotkey_mm_yellow').css({ "background-color": "" }); - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); __uifxn_AppFull_TopWidjetShow(true); }); }); } - } else if (_state.menu.stage == "hotkey_mm_blue") { + } else if (_state.menu.stage.cur == "hotkey_mm_blue") { console.log("HOTKEY(MM:BLUE) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { console.log("LEFT"); @@ -5115,13 +5043,13 @@ HotelTV.ui_appfull = (function() { $('.popup .hotkey_mm_blue').fadeOut(1000, function() { $('.popup .hotkey_mm_blue').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() { $('.popup .hotkey_mm_blue').css({ "background-color": "" }); - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); __uifxn_AppFull_TopWidjetShow(true); }); }); } - } else if (_state.menu.stage == "hotkey_mm_amenity") { + } else if (_state.menu.stage.cur == "hotkey_mm_amenity") { console.log("HOTKEY(MM:AMENITY: MENU) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { console.log("AMENITY::>LEFT"); @@ -5138,16 +5066,16 @@ HotelTV.ui_appfull = (function() { } else if (_evt.keyCode == gRmtKey.enter) { console.log("AMENITY::>ENTER"); __uifxn_AppFull_HandleAmenity("enter", false, false, function() { - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); }); } else if (_evt.keyCode == gRmtKey.back) { __uifxn_AppFull_HandleAmenity("back", true, false, function() { - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); }); } - } else if (_state.menu.stage == "hotkey_mm_roomservice") { + } else if (_state.menu.stage.cur == "hotkey_mm_roomservice") { console.log("HOTKEY(MM:ROOMSERVICE: MENU) KEY EVENT::> " + _evt.keyCode); if (_evt.keyCode == gRmtKey.left) { console.log("ROOMSERVICE::>LEFT"); @@ -5164,12 +5092,12 @@ HotelTV.ui_appfull = (function() { } else if (_evt.keyCode == gRmtKey.enter) { console.log("ROOMSERVICE::>ENTER"); __uifxn_AppFull_HandleRoomservice("enter", false, false, function() { - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); }); } else if (_evt.keyCode == gRmtKey.back) { __uifxn_AppFull_HandleRoomservice("back", true, false, function() { - _state.menu.stage = "main"; + _state.menu.stage.cur = "main"; __uifxn_AppFull_ShowMMHotKeyBtn(true); }); } @@ -5222,6 +5150,8 @@ HotelTV.ui_appfull = (function() { document.addEventListener("hcap_application_focus_changed", __uifxn_AppFull_OnAppFocusEvt, false); //ADD Event for the result of HDMI connection change document.addEventListener("hdmi_connection_changed", __uifxn_AppFull_OnHdmiConChangeEvt, false); + //ADD Event for the result of channel changed + document.addEventListener("channel_changed", __uifxn_AppFull_OnTvChChgChangeEvt, false); }, Show: function() { @@ -5233,6 +5163,44 @@ HotelTV.ui_appfull = (function() { __uifxn_AppFull_BldPage_Main(); }, + BGServiceEvent: function(_evt) { + let _state = HotelTV.state; + let _program = HotelTV.tvguide.program; + + if ( _evt == "update_flight" ){ + _state.schedule.flight_reflash = true; + }else if ( _evt == "update_weather" ){ + _state.schedule.weather_reflash = true; + } + + // Update flight schedule table if user doesn't watch flight schedule screen + if ( _state.schedule.flight_reflash == true) { + //if (_program[Number(_state.menu.main.cur)].type.toLowerCase() != "flight") + { + _state.schedule.flight_reflash = false; + console.warn("Updated flight scheudle UI table."); + + //Flight Contents Buildup + __uifxn_AppFull_MM_BldFlight(); + } + } + + // Update weather schedule table if user doesn't watch weather screen + if ( _state.schedule.weather_reflash == true) { + if (_program[Number(_state.menu.main.cur)].type.toLowerCase() != "weather"){ + _state.schedule.weather_reflash = false; + console.log("Updated Weather UI table."); + + //Weather Contents Buildup + if ( Object.keys(_state.weather.default_location).length != 0 ){ + //상단 날씨 아이콘 및 온도 표시 + __uifxn_AppFull_TopWidjet_BuildWeather(); + __uifxn_AppFull_MM_BldWeather(); + } + } + } + }, + MqttEvent: function(_evt) { let _state = HotelTV.state; @@ -5274,7 +5242,7 @@ HotelTV.ui_appfull = (function() { }); // 사용자가 메시지 메뉴를 사용중인경우에 대한 처리 - if (_state.menu.stage == "popup_message_card" || _state.menu.stage == "mypage") { + if (_state.menu.stage.cur == "popup_message_card" || _state.menu.stage.cur == "mypage") { const _mmIdx = _state.menu.main.cur; // 메시지 상태 오브젝트 초기화 if ("message" in _state.menu.main[_mmIdx]) { @@ -5320,15 +5288,78 @@ HotelTV.ui_appfull = (function() { } 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 == "GUEST-CHECKIN") { } else if (_evt == "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 == "GUEST-UPDATE") { } else if (_evt == "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}]) + } + }); } }, @@ -5336,7 +5367,7 @@ HotelTV.ui_appfull = (function() { let _state = HotelTV.state; let _trTbl = HotelTV.translation; - if (_state.menu.stage != 'tvCtgHide') { + if (_state.menu.stage.cur != 'tvCtgHide') { return; } diff --git a/procentric/application/lib/hoteltv.ui_utils.js b/procentric/application/lib/hoteltv.ui_utils.js index 0f450c3..8be0f6c 100755 --- a/procentric/application/lib/hoteltv.ui_utils.js +++ b/procentric/application/lib/hoteltv.ui_utils.js @@ -139,6 +139,29 @@ HotelTV.ui_utils = (function() { } }, + ShowSysNoticeMsg: function(_show, _type, _title, _msg, _cdn_obj) { + if (_show) { + $('.error').css('background-color', '#000000').css('opacity', 0.8); + if ( _type == "notice"){ + $('.error #details #message').addClass("notice"); + } + $('.error #details #title').text(_title); + $('.error #details #message').text(_msg); + $('.error').fadeIn(500); + if (_cdn_obj) { + setTimeout(function(){ + var dt = new Date(); + dt.setSeconds(dt.getSeconds() + Number(_cdn_obj.timeout)); + __uiFxn_TmrCDnErrScreen(dt, _cdn_obj.cb_disp, _cdn_obj.cb_eoe); + }, 5000); + } + } else { + $('.error').fadeOut(500, function() { + $(this).css("background-image", "None"); + }); + } + }, + GetCur_DateTime: function() { let week = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']; let cd = new Date(); diff --git a/procentric/application/lib/hoteltv.ui_welcome.js b/procentric/application/lib/hoteltv.ui_welcome.js index 7b4144a..a105df6 100755 --- a/procentric/application/lib/hoteltv.ui_welcome.js +++ b/procentric/application/lib/hoteltv.ui_welcome.js @@ -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(); }, + + } })(); \ No newline at end of file diff --git a/procentric/application/wellcome.html b/procentric/application/wellcome.html index db07efa..5ede43d 100755 --- a/procentric/application/wellcome.html +++ b/procentric/application/wellcome.html @@ -6,6 +6,7 @@ + CENTIRM LG-PROCENTRIC HOTEL SERVICE @@ -86,6 +87,9 @@ + + +