issue #10 #11 #12 Apply system reboot feature on instant_power mode set as 2. Change language popup titile and usage displaying method.

This commit is contained in:
paul kim
2024-09-05 12:35:44 +09:00
parent baf7697664
commit 91cd321a59
5 changed files with 11185 additions and 47 deletions

View File

@@ -46,6 +46,11 @@ HotelTV.hal = (function() {
'end_of_item'
];
let hcap_property_installer_menuItem_key = [
hcap.property.InstallerMenuItem.POWER_MANAGE,
hcap.property.InstallerMenuItem.MAX_VOLUME
];
const g_media = {
@@ -113,7 +118,7 @@ HotelTV.hal = (function() {
};
/**
* HCAP Wrapper Function::> Get Device Properties(Realted HCAP API:hcap.property.setProperty)
* HCAP Wrapper Function::> Set Device Properties(Realted HCAP API:hcap.property.setProperty)
* @param {string} sz_key property key name.
* @param {object} value is object to setting property
*/
@@ -129,6 +134,39 @@ HotelTV.hal = (function() {
});
};
/**
* HCAP Wrapper Function::> Get Installer Menu Item(Realted HCAP API:hcap.property.getInstallerMenuItem)
* @param {string} sz_key installer menu item key name.
*/
function __hcapfxn_get_installer_menuItem(sz_key) {
return new Promise((resolve, reject) => {
let param = {
"key": sz_key,
"onSuccess": function(s) { resolve({ "key": sz_key, "value": s.value }) },
//"onFailure": function(f) { reject({ "key": sz_key, "value": "unknown" }) }
"onFailure": function(f) { resolve({ "key": sz_key, "value": "unknown" }) }
};
hcap.property.getInstallerMenuItem(param);
});
};
/**
* HCAP Wrapper Function::> Set Installer Menu Item(Realted HCAP API:hcap.property.setInstallerMenuItem)
* @param {string} sz_key installer menu item key name.
* @param {object} value is object to setting installer menu item
*/
function __hcapfxn_set_installer_menuItem(sz_key, value) {
return new Promise((resolve, reject) => {
let param = {
"key": sz_key,
"value": value.toString(),
"onSuccess": function(s) { resolve({ "key": sz_key, "value": value }) },
"onFailure": function(f) { resolve({ "key": sz_key, "value": "unknown" }) }
};
hcap.property.setInstallerMenuItem(param);
});
};
/**
* IDCAP Wrapper Function::> Get Device Configuration(Properties)(Realted IDCAP API:idcap://configuration/property/get)
* @param {string} sz_key property key name.
@@ -671,7 +709,7 @@ HotelTV.hal = (function() {
return new Promise((resolve, reject) => {
hcap.network.getNetworkInformation({
"onSuccess" : function(s) {
console.log("onSuccess : network_mode = " + s.network_mode +
console.log("onSuccess : network_mode = " + s.network_mode +
"\n ssid = " + s.ssid +
"\n eth_speed = " + s.eth_speed +
"\n eth_duplex = " + s.eth_duplex +
@@ -691,7 +729,7 @@ HotelTV.hal = (function() {
"\n wifi_plugged = " + s.wifi_plugged +
"\n dhcp_state = " + s.dhcp_state);
resolve({ "error": false, "info": s });
},
},
"onFailure" : function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "error": true, "info": null });
@@ -955,10 +993,39 @@ HotelTV.hal = (function() {
let _instant_pwr_target_mode = Number(_devconfig.system.misc.instantPower);
if (_devinfo["instant_power"] != _instant_pwr_target_mode) {
_pmFxnArProperty.push(__hcapfxn_set_property('instant_power', _instant_pwr_target_mode));
// hcap.property.InstallerMenuItem.POWER_MANAGE 설정
if ( _instant_pwr_target_mode==2 ) {
//
hcap.property.setInstallerMenuItem({
"key" : hcap.property.InstallerMenuItem.POWER_MANAGE,
"value" : 8,
"onSuccess" : function() {
console.log("onSuccess");
},
"onFailure" : function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
}
});
} else {
// Sets number of hours of no activity before automatic shut off. (0 ~ 7)
hcap.property.setInstallerMenuItem({
"key" : hcap.property.InstallerMenuItem.POWER_MANAGE,
"value" : 0,
"onSuccess" : function() {
console.log("onSuccess");
},
"onFailure" : function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
}
});
}
}
if ( _instant_pwr_target_mode==2 || _instant_pwr_target_mode==1 ){
_pmFxnArProperty.push(__hcapfxn_set_powermode('power_mode', hcap.power.PowerMode.WARM));
if (_devinfo["power_mode"] != hcap.power.PowerMode.WARM) {
_pmFxnArProperty.push(__hcapfxn_set_powermode('power_mode', hcap.power.PowerMode.WARM));
}
}
}
@@ -1771,7 +1838,7 @@ HotelTV.hal = (function() {
},
/**
* _keyValue는 아래 코드중 하나
* _keyValue는 아래 코드중 하나
* hcap.key.Code.ENTER
* hcap.key.Code.LEFT
* hcap.key.Code.RIGHT
@@ -1780,12 +1847,12 @@ HotelTV.hal = (function() {
* hcap.key.Code.DOWN
* hcap.key.Code.CH_UP
* hcap.key.Code.CH_DOWN
* @param {enum} _keyValue
* @param {enum} _keyValue
*/
SendVirKeyEvent: function(_keyValue) {
hcap.key.sendKey({
"virtualKeycode" : _keyValue,
"onSuccess" : function() { },
"onSuccess" : function() { },
"onFailure" : function(f) {
console.error("onFailure : errorMessage = " + f.errorMessage);
}

View File

@@ -313,12 +313,12 @@ HotelTV.ui_appfull = (function() {
const _state = HotelTV.state;
let _cur_date = new Date();
let _valid_state_keyEvtOnTv = ["tvCtgShow", "tvCtgHide", "tvShortcut"];
if ( __uifxn_Utils_CheckKeyisNumber(_evt.keyCode)==true ){
if ( _valid_state_keyEvtOnTv.includes(_state.menu.stage.cur)==true ){
_tmrEvt.keyevt.tv_numBtn = _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 ) {
@@ -3966,8 +3966,8 @@ HotelTV.ui_appfull = (function() {
/**
* Return tv cagegory id by name
* @param {string} _ctgy_name
* @returns
* @param {string} _ctgy_name
* @returns
*/
function __uifxn_AppFull_TVCtgyIdByName(_ctgy_name="all") {
let _program = HotelTV.tvguide.program;
@@ -4048,11 +4048,11 @@ HotelTV.ui_appfull = (function() {
_epgProgInf_Prev = _epg_prom_info[_j-1];
_schTmPrev.setHours(Number(_epgProgInf_Prev.time.charAt(0) + _epgProgInf_Prev.time.charAt(1)));
_schTmPrev.setMinutes(Number(_epgProgInf_Prev.time.charAt(3) + _epgProgInf_Prev.time.charAt(4)));
}
}
let _t_playTotal = Math.round((_schTmCur - _schTmPrev) / 60000); //Total play time in minuate
let _t_playRemain = Math.round((_schTmCur - _tm_cur) / 60000); //Remain play time in minuate
_rtn_epg = _epgProgInf_Cur;
if (_t_playRemain >= 0) {
//console.log("CHNAME::>" + _ch_name + " Remaining::> " + _t_playRemain);
@@ -4111,7 +4111,7 @@ HotelTV.ui_appfull = (function() {
}
else
{
if ( _tm_diff_ms_tvctrl>=5000 )
if ( _tm_diff_ms_tvctrl>=5000 )
{
if ( _state.menu.stage.cur=="tvCtgShow" || _state.menu.stage.cur=="tvCtgHide" )
{
@@ -4135,7 +4135,7 @@ HotelTV.ui_appfull = (function() {
___ifxn_hideTvEpgFrm();
}
}
}
}
}
}
@@ -4173,7 +4173,7 @@ HotelTV.ui_appfull = (function() {
___ifxn_fadeout_shortcutFrm();
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _state.tv.shortkey.ch_item_idx!=null ) {
const _mmIdx_tv = _state.menu.main.cur;
let _tvCtgAllIdx = _state.menu.main[_mmIdx].cur = __uifxn_AppFull_TVCtgyIdByName("all");
@@ -4786,8 +4786,8 @@ HotelTV.ui_appfull = (function() {
/**
* HotelTV UI[AppFull] Wrapper Function::> request tv channel function
* @param {Number} _force_ctg_item_idx
* @param {Number} _force_ch_item_idx
* @param {Number} _force_ctg_item_idx
* @param {Number} _force_ch_item_idx
* @param {function} _cbfxn_success
* @param {function} _cbfxn_failure
*/
@@ -4933,8 +4933,8 @@ HotelTV.ui_appfull = (function() {
// _chNumber는 -기준으로 잘라낸 앞숫자, 예를들면 16-1이라면 _chNumber는 16이 됨.
let _ChNumStr = __ifxn_getChItemValue(_ChItem, "number").toString();
let _ChNumber = Number(_ChNumStr.split('-')[0]);
// Find out matched channel
// Find out matched channel
if ( _ChNumber==Number(_strReqNumNext) ){
// Find out
_state.tv.shortkey.ch_item_idx = Number(__ifxn_getChItemIdxByNumber(_ChNumStr));
@@ -5155,7 +5155,7 @@ HotelTV.ui_appfull = (function() {
let _egp_prog_inf = null;
//Update channel logo image
//Update channel logo image
_elDivTvChLogo.css({ "background-image": "url(" + _tvChInfo.logo.file.download + ")" });
//Update channel number
@@ -5168,25 +5168,25 @@ HotelTV.ui_appfull = (function() {
if (_egp_prog_inf.epg_info != null) {
_elDivTvChEpgTitle.text(_egp_prog_inf.epg_info.name);
_elDivTvChEpgDetails.find('#tm_playing').text(_trTbl.ui.tv.epg.progamtime[_state.lang] + _egp_prog_inf.epg_info.playing_time);
//let _new_progress_bar_width = parseInt(_elDivTvChEpgDetails.find("#tm_chart").width()*_egp_prog_inf.epg_info.progress_pcent/100);
let _new_progress_bar_width = parseInt(835*_egp_prog_inf.epg_info.progress_pcent/100);
_elDivTvChEpgDetails.find('.progress').width(_new_progress_bar_width);
} else {
_elDivTvChEpgTitle.text("");
_elDivTvChEpgDetails.find('#tm_playing').text("");
//let _new_progress_bar_width = parseInt(_elDivTvChEpgDetails.find("#tm_chart").width()*_egp_prog_inf.epg_info.progress_pcent/100);
let _new_progress_bar_width = 0;
_elDivTvChEpgDetails.find('.progress').width(_new_progress_bar_width);
}
// Fade in epg
__uifxn_AppFull_TVEpgFadeIn();
// Fade in epg
__uifxn_AppFull_TVEpgFadeIn();
if (_action == "on_load") {
//_state.menu.stage.cur = "tvCtgShow";
// TODO: Request Channel
// TODO: Request Channel
} else if (_action == "ch_up") {
// TODO: Request Channel
} else if (_action == "ch_down") {
@@ -5975,7 +5975,7 @@ HotelTV.ui_appfull = (function() {
__ifxn_exitTvMenu();
} else if ( __uifxn_Utils_CheckKeyisNumber(event.keyCode)==true ){
//Navigate TV shortcut lists
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
_state.menu.stage.cur = "tvShortcut";
__uifxn_AppFull_TVDrawShortcutKey_Mode0(event.keyCode);
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
@@ -6001,10 +6001,10 @@ HotelTV.ui_appfull = (function() {
__ifxn_exitTvMenu();
} else if ( __uifxn_Utils_CheckKeyisNumber(event.keyCode)==true ) {
//Navigate TV shortcut lists
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
_state.menu.stage.cur = "tvShortcut";
__uifxn_AppFull_TVDrawShortcutKey_Mode0(event.keyCode);
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
if ( __uifxn_AppFull_TVDrawShortcutKey_Mode1(true, "build", event.keyCode)==0 ){
_state.menu.stage.prev = _state.menu.stage.cur;
_state.menu.stage.cur = "tvShortcut";
@@ -6017,18 +6017,18 @@ HotelTV.ui_appfull = (function() {
// console.log("TV shortcut routine: key:" + event.keyCode);
if (event.keyCode == gRmtKey.back) {
// TV메뉴로 복귀
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
//
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
__uifxn_AppFull_TVDrawShortcutKey_Mode1(false, "exitWithoutChchange", event.keyCode);
}
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
} else if (event.keyCode == gRmtKey.enter) {
// 번호키를 이용한 채널 선택 팝업 삭제
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
//
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
__uifxn_AppFull_TVDrawShortcutKey_Mode1(false, "exitWithChchange", event.keyCode);
}
_state.menu.stage.cur = _state.menu.stage.prev;
@@ -6037,13 +6037,13 @@ HotelTV.ui_appfull = (function() {
_tmrEvt.keyevt.tv_ctrl = new Date();
_tmrEvt.keyevt.tv_ctrl.setSeconds(_tmrEvt.keyevt.tv_ctrl.getSeconds() - 3);
} else if ( __uifxn_Utils_CheckKeyisNumber(event.keyCode)==true ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
__uifxn_AppFull_TVDrawShortcutKey_Mode0(event.keyCode);
}
}
} else {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
if ( _programTv.shortcutkeyMode=="mode_0" ) {
//
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
} else if ( _programTv.shortcutkeyMode=="mode_1" ) {
__uifxn_AppFull_TVDrawShortcutKey_Mode1(true, "move", event.keyCode);
}
console.log("TVSHORTCUT CHNUM: " + _state.tv.shortkey.ch_item_idx);
@@ -6126,7 +6126,7 @@ HotelTV.ui_appfull = (function() {
}
}
// Title
// Title
_elLangSelTitleDiv.text(_trTbl.system.szsellanguage[_state.lang]);
// Usages
@@ -6151,6 +6151,19 @@ HotelTV.ui_appfull = (function() {
let _elLangSelUsageDiv = _elLangSelCtrlDiv.children('.usage');
let _elLangSelButtonsDiv = _elLangSelCtrlDiv.children('.buttons');
const ___ifxn_updateLangSelTitleAndUsages = function() {
let __focusedLang = "en-US";
if ( _elLangSelButtonsDiv.find('.focus').length ) {
__focusedLang = _elLangSelButtonsDiv.find('.focus').attr('id');
}
// Title
_elLangSelTitleDiv.text(_trTbl.system.szsellanguage[__focusedLang]);
// Usages
_elLangSelUsageDiv.html(_trTbl.system.lang_sel_usage[__focusedLang]);
}
const ___ifxn_moveLangButton = function(_direction) {
let selectedBtnItemCur = _elLangSelButtonsDiv.find('.focus');
@@ -6173,6 +6186,8 @@ HotelTV.ui_appfull = (function() {
_elLangSelButtonsDiv.find('.langBtn').last().addClass("focus");
}
}
___ifxn_updateLangSelTitleAndUsages();
}
const __ifxn_sendNextLangUsrData = async function(_nextLang, __cbFxnFailure=null, __cbFxn_Success=null) {
@@ -6208,7 +6223,7 @@ HotelTV.ui_appfull = (function() {
_elLangSelDiv.fadeOut(1000, function() {
if ( __cbFxnFailure ){ __cbFxnFailure(); }
});
}
}
}
@@ -6347,7 +6362,7 @@ HotelTV.ui_appfull = (function() {
} else {
if ( _state.menu.stage.cur=="tvCtgShow" || _state.menu.stage.cur=="tvCtgHide" )
{
}
else
{

View File

@@ -1,5 +1,5 @@
<XAIT>
<versionNumber>4</versionNumber>
<versionNumber>27</versionNumber>
<AbstractService>
<svcName>Pro:Centric App</svcName>
<svcId>0x1204</svcId>
@@ -16,10 +16,15 @@
<controlCode>AUTOSTART</controlCode>
<visibility>NOT_VISIBLE_USERS</visibility>
<priority>255</priority>
<version>7</version>
<version>27</version>
</applicationDescriptor>
<HcapDescriptor>
<url>http://10.20.0.2:8880/procentric/application/index.html</url>
<url>http://10.20.0.2:8880/procentric/application/application.zip</url>
<applicationStructure>
<baseDirectory>/</baseDirectory>
<classpathExtension>/</classpathExtension>
<initialClass>index.html</initialClass>
</applicationStructure>
</HcapDescriptor>
</Application>
</ApplicationList>