T_Lib.js 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922
  1. /*****************************************************************************
  2. * AJAX 관련 함수
  3. *****************************************************************************/
  4. function ajaxGet(pageURL)
  5. {
  6. var page = null;
  7. $.ajax({
  8. url: pageURL,
  9. type: 'GET',
  10. dataType: 'text',
  11. timeout: 1000,
  12. async: false,
  13. // error: function(){
  14. // alert('Error: Loading Page(' + pageURL + ')');
  15. // },
  16. success: function(data) {
  17. page = data;
  18. }
  19. });
  20. return page;
  21. }
  22. function ajaxGetAsync(pageURL)
  23. {
  24. var page = null;
  25. $.ajax({
  26. url: pageURL,
  27. type: 'GET',
  28. dataType: 'text',
  29. timeout: 100,
  30. async: true,
  31. // error: function(){
  32. // alert('Error: Loading Page(' + pageURL + ')');
  33. // },
  34. success: function(data) {
  35. page = data;
  36. }
  37. });
  38. return page;
  39. }
  40. function ajaxGetAsyncCb(pageURL, params, dcb, cb)
  41. {
  42. var page = null;
  43. $.ajax({
  44. url: pageURL,
  45. type: 'GET',
  46. dataType: 'text',
  47. timeout: 1000,
  48. async: true,
  49. // error: function(){
  50. // alert('Error: Loading Page(' + pageURL + ')');
  51. // },
  52. success: function(data) {
  53. if(data) {
  54. if (cb != undefined) {
  55. if (dcb != undefined) {
  56. dcb(pageURL, params, data, cb);
  57. }
  58. else {
  59. cb(data);
  60. }
  61. }
  62. }
  63. }
  64. });
  65. }
  66. function ajaxPost(toURL, toData)
  67. {
  68. var result = false;
  69. $.ajax({
  70. url: toURL,
  71. type: 'POST',
  72. dataType: 'text',
  73. timeout: 1000,
  74. // async: false,
  75. data: toData,
  76. // error: function(){
  77. // alert('Error: Post failed.(' + pageURL + ')');
  78. // },
  79. success: function(data) {
  80. result = true;
  81. }
  82. });
  83. return result;
  84. }
  85. function ajaxPostFile(toURL, toData)
  86. {
  87. var result = false;
  88. $.ajax({
  89. url: toURL,
  90. type: 'POST',
  91. contentType: false,
  92. processData: false,
  93. data: toData,
  94. timeout: 5000,
  95. success: function(data) {
  96. result = true;
  97. },
  98. error: function() {
  99. }
  100. });
  101. return result;
  102. }
  103. /*****************************************************************************
  104. * Setup 관련 함수
  105. *****************************************************************************/
  106. function readAuthInfo()
  107. {
  108. var url = "";
  109. var data;
  110. var setupArray = new Array();
  111. url = "/httpapx/ReadParam?action=getauth";
  112. data = ajaxGet(url);
  113. if(data) {
  114. var lines = data.split("\n");
  115. for(i = 0; i < lines.length; i++) {
  116. var token = lines[i].split("=");
  117. if(token.length != 2)
  118. break;
  119. setupArray[token[0]] = token[1];
  120. //console.log(token[0] + " = " + token[1]);
  121. }
  122. }
  123. return setupArray;
  124. }
  125. function readSetupByPage(pageName)
  126. {
  127. var url = "";
  128. var data;
  129. var setupArray = new Array();
  130. url = "/httpapx/ReadParam?action=readpage&page=" + pageName;
  131. data = ajaxGet(url);
  132. if(data) {
  133. var lines = data.split("\n");
  134. for(i = 0; i < lines.length; i++) {
  135. var token = lines[i].split("=");
  136. if(token.length == 2){
  137. setupArray[token[0]] = token[1];
  138. }
  139. else if(token.length == 1){
  140. setupArray[token[0]] = "";
  141. }
  142. else{
  143. var n = lines[i].search("=");
  144. var res = lines[i].substring(n+1);
  145. setupArray[token[0]] = res;
  146. }
  147. }
  148. }
  149. return setupArray;
  150. }
  151. function readSetupByKey(key)
  152. {
  153. var url = "";
  154. var data;
  155. var result = "";
  156. url ="/httpapx/ReadParam?action=readparam&" + key + "=0";
  157. data = ajaxGet(url);
  158. if(data) {
  159. var lines = data.split("\n");
  160. var token = lines[0].split("=");
  161. if(token.length != 2)
  162. return result;
  163. if(token[0] == key)
  164. result = token[1];
  165. }
  166. return result;
  167. }
  168. function readSetupByKey2(key) // Multi Line
  169. {
  170. var url = "";
  171. var data;
  172. var result = "";
  173. url = "/httpapx/ReadParam?action=readparam&" + key + "=0";
  174. data = ajaxGet(url);
  175. if(data) {
  176. var token = data.split("=");
  177. if (token.length != 2)
  178. return result;
  179. if (token[0] == key)
  180. result = token[1];
  181. }
  182. return result;
  183. }
  184. function __dcb_readSetupByKeyAsync(url, key, data, cb)
  185. {
  186. var result = "";
  187. if (data) {
  188. var lines = data.split("\n");
  189. var token = lines[0].split("=");
  190. if(token.length != 2)
  191. cb(result);
  192. if(token[0] == key)
  193. result = token[1];
  194. }
  195. cb(result);
  196. }
  197. function readSetupByKeyAsync(key, cb)
  198. {
  199. var url = "";
  200. url ="/httpapx/ReadParam?action=readparam&" + key + "=0";
  201. ajaxGetAsyncCb(url, key, __dcb_readSetupByKeyAsync, cb);
  202. }
  203. function readSetupByKeyArray(keyArray)
  204. {
  205. //alert("readSetupByKeyArray is not implemented");
  206. }
  207. function readDefaultByKey(key)
  208. {
  209. var url = "";
  210. var data;
  211. var result = "";
  212. url ="/httpapx/ReadParam?action=readdefault&" + key + "=0";
  213. data = ajaxGet(url);
  214. if(data) {
  215. var lines = data.split("\n");
  216. var token = lines[0].split("=");
  217. if(token.length != 2)
  218. return result;
  219. if(token[0] == key)
  220. result = token[1];
  221. }
  222. return result;
  223. }
  224. function writeSetup(params)
  225. {
  226. var url;
  227. url = "/httpapx/WriteParam?action=writeparam&" + params;
  228. return ajaxGet(url);
  229. }
  230. function writeSetupAsync(params)
  231. {
  232. var url;
  233. url = "/httpapx/WriteParam?action=writeparam&" + params;
  234. return ajaxGetAsync(url);
  235. }
  236. function writeState(params)
  237. {
  238. var url;
  239. url = "/httpapx/SetState?action=setoutput&" + params;
  240. return ajaxGet(url);
  241. }
  242. function writeStateAsync(params)
  243. {
  244. var url;
  245. url = "/httpapx/SetState?action=setoutput&" + params;
  246. return ajaxGetAsync(url);
  247. }
  248. /******************************************************************************
  249. * State 관련 함수
  250. *****************************************************************************/
  251. function _readState(params)
  252. {
  253. var url = "";
  254. var data;
  255. var stateArray = new Array();
  256. url = "/httpapx/GetState?" + params;
  257. data = ajaxGet(url);
  258. if(data) {
  259. var lines = data.split("\n");
  260. for(i = 0; i < lines.length; i++) {
  261. var token = lines[i].split("=");
  262. if(token.length != 2)
  263. break;
  264. stateArray[token[0]] = token[1];
  265. }
  266. }
  267. return stateArray;
  268. }
  269. function __dcb_readStateAsync(url, params, data, cb)
  270. {
  271. var stateArray = new Array();
  272. if(data) {
  273. var lines = data.split("\n");
  274. for(i = 0; i < lines.length; i++) {
  275. var token = lines[i].split("=");
  276. if(token.length != 2)
  277. break;
  278. stateArray[token[0]] = token[1];
  279. }
  280. }
  281. cb(stateArray);
  282. }
  283. function _readStateAsync(params, cb)
  284. {
  285. var url = "";
  286. url = "/httpapx/GetState?" + params;
  287. ajaxGetAsyncCb(url, params, __dcb_readStateAsync, cb);
  288. }
  289. function _readData(params)
  290. {
  291. var url = "";
  292. var data;
  293. url = "/httpapx/GetState?" + params;
  294. return ajaxGet(url);
  295. }
  296. function readRateState()
  297. {
  298. var result;
  299. result = _readState(
  300. "action=getrate&GRS_VENCFRAME1=0&GRS_VENCBITRATE1=0&GRS_VENCFRAME2=0&GRS_VENCBITRATE2=0&GRS_VENCFRAME3=0&GRS_VENCBITRATE3=0&GRS_VENCFRAME4=0&GRS_VENCBITRATE4=0&GRS_AENCBITRATE1=0&GRS_ADECBITRATE1=0&GRS_ADECALGORITHM1=0&GRS_ADECSAMPLERATE1=0");
  301. return result;
  302. }
  303. function readRateState_SCoding()
  304. {
  305. var result;
  306. result = _readState(
  307. "action=getrate&GRS_VENCFRAME1=0&GRS_VENCBITRATE1=0&GRS_VENCFRAME2=0&GRS_VENCBITRATE2=0&GRS_VENCFRAME3=0&GRS_VENCBITRATE3=0&GRS_VENCFRAME4=0&GRS_VENCBITRATE4=0&GRS_AENCBITRATE1=0&GRS_ADECBITRATE1=0&GRS_ADECALGORITHM1=0&GRS_ADECSAMPLERATE1=0&GRS_VENCIDR1=0&GRS_VENCPIDR1=0&GRS_VENCPBASE1=0&GRS_VENCIDR2=0&GRS_VENCPIDR2=0&GRS_VENCPBASE2=0&GRS_VENCIDR3=0&GRS_VENCPIDR3=0&GRS_VENCPBASE3=0&GRS_VENCIDR4=0&GRS_VENCPIDR4=0&GRS_VENCPBASE4=0");
  308. return result;
  309. }
  310. function readInputState()
  311. {
  312. var result;
  313. result = _readState(
  314. "action=getinput&GIS_SENSOR1=0&GIS_SENSOR2=0&GIS_SENSOR3=0&GIS_SENSOR4=0&GIS_SENSOR5=0&GIS_MOTION1=0&GIS_MOTION2=0&GIS_MOTION3=0&GIS_MOTION4=0&GIS_VIDEOLOSS1=0&GIS_VIDEOLOSS2=0&GIS_VIDEOLOSS3=0&GIS_VIDEOLOSS4=0&GIS_ALARM1=0&GIS_ALARM2=0&GIS_ALARM3=0&GIS_ALARM4=0&GIS_RECORD1=0&GIS_AIRWIPER=0");
  315. return result;
  316. }
  317. function readInputStateAsync(cb)
  318. {
  319. var result;
  320. result = _readStateAsync(
  321. "action=getinput&GIS_SENSOR1=0&GIS_SENSOR2=0&GIS_SENSOR3=0&GIS_SENSOR4=0&GIS_SENSOR5=0&GIS_MOTION1=0&GIS_MOTION2=0&GIS_MOTION3=0&GIS_MOTION4=0&GIS_VIDEOLOSS1=0&GIS_VIDEOLOSS2=0&GIS_VIDEOLOSS3=0&GIS_VIDEOLOSS4=0&GIS_ALARM1=0&GIS_ALARM2=0&GIS_ALARM3=0&GIS_ALARM4=0&GIS_RECORD1=0&GIS_AIRWIPER=0", cb);
  322. return;
  323. }
  324. function readRateStateDec()
  325. {
  326. var result;
  327. result = _readState(
  328. "action=getrate&GRS_VDECALGORITHM1=0&GRS_VDECFRAME1=0&GRS_VDECBITRATE1=0&GRS_VDECALGORITHM2=0&GRS_VDECFRAME2=0&GRS_VDECBITRATE2=0&GRS_VDECALGORITHM3=0&GRS_VDECFRAME3=0&GRS_VDECBITRATE3=0&GRS_VDECALGORITHM4=0&GRS_VDECFRAME4=0&GRS_VDECBITRATE4=0&GRS_AENCBITRATE1=0&GRS_ADECBITRATE1=0&GRS_ADECALGORITHM1=0&GRS_ADECSAMPLERATE1=0");
  329. return result;
  330. }
  331. function readRateState410()
  332. {
  333. var result;
  334. result = _readState(
  335. "action=getrate&GRS_VENCFRAME1=0&GRS_VENCBITRATE1=0&GRS_VENCFRAME2=0&GRS_VENCBITRATE2=0&GRS_VENCFRAME3=0&GRS_VENCBITRATE3=0&GRS_VENCFRAME4=0&GRS_VENCBITRATE4=0&GRS_VENCFRAME5=0&GRS_VENCBITRATE5=0&GRS_AENCBITRATE1=0&GRS_ADECBITRATE1=0&GRS_ADECALGORITHM1=0&GRS_ADECSAMPLERATE1=0");
  336. return result;
  337. }
  338. function readRateStateA400()
  339. {
  340. var result;
  341. result = _readState(
  342. "action=getrate&GRS_VENCFRAME1=0&GRS_VENCBITRATE1=0&GRS_VENCFRAME2=0&GRS_VENCBITRATE2=0&GRS_VENCFRAME3=0&GRS_VENCBITRATE3=0&GRS_VENCFRAME4=0&GRS_VENCBITRATE4=0&GRS_VENCFRAME5=0&GRS_VENCBITRATE5=0&GRS_VENCFRAME6=0&GRS_VENCBITRATE6=0&GRS_VENCFRAME7=0&GRS_VENCBITRATE7=0&GRS_VENCFRAME8=0&GRS_VENCBITRATE8=0&GRS_VENCFRAME9=0&GRS_VENCBITRATE9=0&GRS_VENCFRAME10=0&GRS_VENCBITRATE10=0");
  343. return result;
  344. }
  345. function readSerialState()
  346. {
  347. var result;
  348. result = _readState(
  349. "action=getrate&GRS_STXRATE1=0&GRS_SRXRATE1=0&GRS_STXRATE2=0&GRS_SRXRATE2=0");
  350. return result;
  351. }
  352. function readSystemState()
  353. {
  354. var result;
  355. result = _readState("action=getinfo&GIN_READ=0");
  356. return result;
  357. }
  358. function readSystemConn()
  359. {
  360. var result;
  361. result = _readData("action=getinfo&GIN_CONN=0");
  362. return result;
  363. }
  364. function readSystemLog()
  365. {
  366. var result;
  367. result = _readData("action=getlog&GLO_READ=0");
  368. return result;
  369. }
  370. function readSystemNewLog(params)
  371. {
  372. var result;
  373. var url = "";
  374. url = "action=getnewlog&GNL_READ=" + params;
  375. result = _readData(url);
  376. return result;
  377. }
  378. function runGeneralCommand(str)
  379. {
  380. var cmd = "action=command&Command=" + str;
  381. var result;
  382. result = _readData(cmd);
  383. return result;
  384. }
  385. function stopGeneralCommand(str)
  386. {
  387. var cmd = "action=command&Stop=" + str;
  388. var result;
  389. result = _readData(cmd);
  390. return result;
  391. }
  392. /******************************************************************************
  393. * Style 관련 함수
  394. *****************************************************************************/
  395. function initLoading()
  396. {
  397. $("#PopupMessage").html("<img src=\"img/loading.gif\"></img>").hide();
  398. }
  399. function showLoading()
  400. {
  401. var popup = $("#PopupMessage");
  402. width = popup.width();
  403. height = popup.height();
  404. popup.css("position","absolute")
  405. .css("z-index","10001")
  406. .css("top","30%")
  407. .css("left","50%")
  408. .css("margin-left", -1 * width / 2)
  409. .css("margin-top", -1 * height / 2);
  410. popup.show();
  411. }
  412. function hideLoadingDelay(delay)
  413. {
  414. setTimeout(function() { $("#PopupMessage").hide(); }, delay);
  415. }
  416. function beautifyButtons()
  417. {
  418. // change design
  419. $(":input[type=radio]").button({ icons: { primary: "ui-icon-blank" } });
  420. $(":input[type=checkbox]").button({ icons: { primary: "ui-icon-blank" } });
  421. $("label.ui-button" ).css("height", "22px").css("font-size", "12px").css("padding-top", ".2em");
  422. $("a.ui-slider-handle").button({ icons: { primary: "ui-icon-blank" } , text: false });
  423. // apply default button image
  424. $(":input[type=radio]").button({ icons: { primary: "ui-icon-blank" } });
  425. $(":input[type=radio]:checked").button({ icons: { primary: "ui-icon-radio-on" } });
  426. $(":input[type=checkbox]").button({ icons: { primary: "ui-icon-blank" } });
  427. $(":input[type=checkbox]:checked").button({ icons: { primary: "ui-icon-check" } });
  428. // install change event for icon change
  429. $( ":input[type=radio]" ).change(function(event) {
  430. id = $(this).attr("id");
  431. name = $(this).attr("name");
  432. $(":input[name=" + name + "]").button({ icons: { primary: "ui-icon-blank" } });
  433. $("#" + id).button({ icons: { primary: "ui-icon-radio-on" } });
  434. });
  435. $( ":input[type=checkbox]" ).change(function(event) {
  436. id = $(this).attr("id");
  437. if($("#" + id).prop("checked") == true){
  438. $("#" + id).button({ icons: { primary: "ui-icon-check" } });
  439. }
  440. else{
  441. $("#" + id).button({ icons: { primary: "ui-icon-blank" } });
  442. }
  443. initLanguage();
  444. });
  445. }
  446. function beautifyRadioButtonsInGroup(groupId)
  447. {
  448. // change design
  449. $(groupId + " :radio").button({ icons: { primary: "ui-icon-blank" } });
  450. $("label.ui-button" ).css("height", "22px").css("font-size", "12px").css("padding-top", ".2em");
  451. // apply default button image
  452. $(groupId + " :radio").button({ icons: { primary: "ui-icon-blank" } });
  453. $(groupId + " :radio:checked").button({ icons: { primary: "ui-icon-radio-on" } });
  454. // install change event for icon change
  455. $( groupId + " :radio" ).change(function(event) {
  456. id = $(this).attr("id");
  457. name = $(this).attr("name");
  458. $(groupId + " :input[name=" + name + "]").button({ icons: { primary: "ui-icon-blank" } });
  459. $("#" + id).button({ icons: { primary: "ui-icon-radio-on" } });
  460. });
  461. }
  462. function beautifyButtonsForRadio()
  463. {
  464. // change design
  465. $(":input[type=radio]").button({ icons: { primary: "ui-icon-blank" } });
  466. $("label.ui-button" ).css("height", "22px").css("font-size", "12px").css("padding-top", ".2em");
  467. // apply default button image
  468. $(":input[type=radio]").button({ icons: { primary: "ui-icon-blank" } });
  469. $(":input[type=radio]:checked").button({ icons: { primary: "ui-icon-radio-on" } });
  470. // install change event for icon change
  471. $( ":input[type=radio]" ).change(function(event) {
  472. id = $(this).attr("id");
  473. name = $(this).attr("name");
  474. $(":input[name=" + name + "]").button({ icons: { primary: "ui-icon-blank" } });
  475. $("#" + id).button({ icons: { primary: "ui-icon-radio-on" } });
  476. });
  477. }
  478. function beautify() {
  479. $("select").customSelect();
  480. }
  481. function disableButton(obj)
  482. {
  483. obj.attr("disabled", "disabled");
  484. }
  485. function enableButtonDelay(obj, delay)
  486. {
  487. setTimeout(function() { obj.removeAttr("disabled"); }, delay);
  488. }
  489. const SUPPORT_MULTI_DEVICE_NONE_TYPE = 0 ;
  490. const SUPPORT_MULTI_DEVICE_DETECTION_CAM_TYPE = 1 ;
  491. const SUPPORT_MULTI_DEVICE_PTZ_TYPE = 2 ;
  492. var support_multi_device_type = SUPPORT_MULTI_DEVICE_NONE_TYPE ;
  493. var support_multi_device_ipaddress = "";
  494. /*****************************************************************************/
  495. function loadSetupTemplate(product)
  496. {
  497. url = "/product/" + product + "/template.html";
  498. contents = ajaxGet(url);
  499. $("body").html(contents);
  500. var setup = readSetupByPage("setuptemplate");
  501. var mode = setup["SYS_MODE"];
  502. var ptztype = setup["SYS_PTZ_TYPE"];
  503. var boardid = setup["SYS_BOARDID"];
  504. var moduletype = setup["SYS_MODULE_TYPE"];
  505. var moduledetail = setup["SYS_MODULE_DETAIL"];
  506. var ft_ir4 = setup["SYS_FTCAMERA_IR4"];
  507. var support_location_osd = (((boardid & 0xF000) == 0xB000) || ((boardid & 0xF000) == 0x9000) || ((boardid & 0xF00F) == 0xA004) || ((boardid & 0xF000) == 0xE000)) && (7 == ptztype) ; // (3519A || 3519 || CV2) && TRUEN ZOOM MODULE
  508. if( ((boardid & 0xF000) == 0x9000 || (boardid & 0xF000) == 0xA000 || (boardid & 0xF000) == 0xB000 ) && ( (4 == ft_ir4) ) ) {
  509. // if( ((boardid & 0xF000) == 0x9000 || (boardid & 0xF000) == 0xA000 || (boardid & 0xF000) == 0xB000 ) && ( (4 == ft_ir4) || (3 == ft_ir4) || (2 == ft_ir4) ) ) {
  510. support_multi_device_type = SUPPORT_MULTI_DEVICE_DETECTION_CAM_TYPE ;
  511. }
  512. else if(0xB001 == boardid) { // A400
  513. support_multi_device_type = SUPPORT_MULTI_DEVICE_PTZ_TYPE ;
  514. }
  515. else {
  516. ;
  517. }
  518. $("[name=li-systemptzcamera]").css("display", "none");
  519. $("[name=li-detectioncam-systemptzcamera]").css("display", "none");
  520. if(SUPPORT_MULTI_DEVICE_DETECTION_CAM_TYPE == support_multi_device_type) {
  521. $("[name=li-detectioncam]").css("display", "");
  522. $("[name=folderble-ptzcam]").css("display", "");
  523. $("[name=li-ptzcam-videoaudio]").css("display", "none");
  524. $("[name=li-ptzcam-videooutput]").css("display", "none");
  525. $("[name=li-ptzcam-imageschedule]").css("display", "none");
  526. $("[name=li-ptzcam-imageircontrol]").css("display", "none");
  527. $("[name=li-ptzcam-eventsilence]").css("display", "none");
  528. $("[name=li-ptzcam-eventshock]").css("display", "none");
  529. $("[name=li-ptzcam-eventsensor]").css("display", "none");
  530. $("[name=li-ptzcam-eventalarm]").css("display", "none");
  531. $("[name=li-ptzcam-record]").css("display", "none");
  532. $("[name=li-ptzcam-device]").css("display", "none");
  533. $("[name=li-ptzcam-ptz]").css("display", "none");
  534. $("[name=li-ptzcam-systemdirectioncamera]").css("display", "none");
  535. $("[name=li-ptzcam-eventva]").css("display", "");
  536. $("[name=li-detectioncam-systemtiltposition]").css("display", "");
  537. $("[name=li-detectioncam-systemexttracking]").css("display", "");
  538. $("[name=li-detectioncam-systemptzcamera]").css("display", "");
  539. $("[name=li-systemptzcamera]").css("display", "none");
  540. var directioncam = readSetupByPage("directioncam");
  541. var protocol = location.protocol;
  542. if (protocol == "https:") {
  543. support_multi_device_ipaddress = protocol + "//" + directioncam["DIRECTIONCAM_IP"] + ":" + directioncam["DIRECTIONCAM_HTTPS_PORT"] + "/" ;
  544. } else {
  545. support_multi_device_ipaddress = "http://" + directioncam["DIRECTIONCAM_IP"] + ":" + directioncam["DIRECTIONCAM_HTTP_PORT"] + "/" ;
  546. }
  547. }
  548. else if(SUPPORT_MULTI_DEVICE_PTZ_TYPE == support_multi_device_type) {
  549. $("[name=li-detectioncam]").css("display", "");
  550. $("[name=folderble-ptzcam]").css("display", "");
  551. $("[name=li-ptzcam-videoaudio]").css("display", "");
  552. $("[name=li-ptzcam-videooutput]").css("display", "");
  553. $("[name=li-ptzcam-imageschedule]").css("display", "");
  554. $("[name=li-ptzcam-imageircontrol]").css("display", "");
  555. $("[name=li-ptzcam-eventsilence]").css("display", "");
  556. $("[name=li-ptzcam-eventshock]").css("display", "");
  557. $("[name=li-ptzcam-eventsensor]").css("display", "");
  558. $("[name=li-ptzcam-eventalarm]").css("display", "");
  559. $("[name=li-ptzcam-record]").css("display", "");
  560. $("[name=li-ptzcam-device]").css("display", "");
  561. $("[name=li-ptzcam-ptz]").css("display", "");
  562. $("[name=li-ptzcam-systemdirectioncamera]").css("display", "");
  563. $("[name=li-detectioncam-systemtiltposition]").css("display", "none");
  564. $("[name=li-detectioncam-systemexttracking]").css("display", "none");
  565. $("[name=li-ptzcam-eventva]").css("display", "none");
  566. $("[name=li-ptzcam-ptzintelligent]").css("display", "none");
  567. $("[name=li-detectioncam-systemptzcamera]").css("display", "none");
  568. $("[name=li-systemptzcamera]").css("display", "");
  569. var directioncam = readSetupByPage("directioncam");
  570. var protocol = location.protocol;
  571. if (protocol == "https:") {
  572. support_multi_device_ipaddress = protocol + "//" + directioncam["DIRECTIONCAM_IP"] + ":" + directioncam["DIRECTIONCAM_HTTPS_PORT"] + "/" ;
  573. } else {
  574. support_multi_device_ipaddress = "http://" + directioncam["DIRECTIONCAM_IP"] + ":" + directioncam["DIRECTIONCAM_HTTP_PORT"] + "/" ;
  575. }
  576. }
  577. else {
  578. $("[name=li-detectioncam]").css("display", "none");
  579. $("[name=folderble-ptzcam]").css("display", "none");
  580. }
  581. if(mode == 0){ // encoder system
  582. $("[name=li-networkremote]").css("display", "none");
  583. $("[name=li-videooutputosd]").css("display", "none");
  584. if((boardid & 0xF000) == 0x4000 && setup["SYS_ISIPCAM"] == 0)
  585. {
  586. // amba encoder does not have composite
  587. if(setup["SYS_AMBA_SUPPORT_HDMI_BCS"] == 0)
  588. {
  589. $("[name=li-image]").css("display", "none");
  590. }
  591. }
  592. }
  593. else{ // decoder system
  594. if((boardid & 0xF000) != 0x3000 && (boardid & 0xF000) != 0xB000) {
  595. $("[name=li-record]").css("display", "none");
  596. $("[name=li-videooutputosd]").css("display", "none");
  597. }
  598. $("[name=li-image]").css("display", "none");
  599. $("[name=li-videoencode]").css("display", "none");
  600. $("[name=li-networkoneway]").css("display", "none");
  601. $("[name=li-networkemail]").css("display", "none");
  602. $("[name=li-networkftp]").css("display", "none");
  603. $("[name=li-eventmotion]").css("display", "none");
  604. $("[name=li-ptzgroup]").css("display", "none");
  605. $("[name=li-ptzadvanced]").css("display", "none");
  606. $("[name=li-networkgoogledrive]").css("display", "none");
  607. }
  608. if(ptztype != 7){
  609. $("[name=li-ptzpattern]").css("display", "none");
  610. $("[name=li-ptzswing]").css("display", "none");
  611. if(moduletype == HITACHI_MODULE){
  612. $("[name=li-imagemask]").css("display", "none");
  613. }
  614. }
  615. if(!support_location_osd) {
  616. $("[name=li-ptzlocationosd]").css("display", "none");
  617. $("[name=li-ptzcam-ptzlocationosd]").css("display", "none");
  618. }
  619. if(setup["SYS_ISIPCAM"] == 0){
  620. $("[name=li-imageschedule]").css("display", "none");
  621. $("[name=li-imagemask]").css("display", "none");
  622. }
  623. if(mode == 0 && ((boardid & 0xF000) == 0x3000 || (boardid & 0xF000) == 0xB000) && setup["SYS_ISIPCAM"] == 0)
  624. $("[name=li-imagemask]").css("display", "");
  625. if(moduledetail == MODULE_TI_TECHWIN_W5)
  626. {
  627. $("[name=li-imageschedule]").css("display", "none");
  628. $("[name=li-imagemask]").css("display", "none");
  629. $("[name=li-videooutput]").css("display", "none");
  630. }
  631. if((boardid & 0xF000) == 0x3000){
  632. $("[name=li-eventsilence]").css("display", "none");
  633. if(boardid == 0x3003){
  634. $("[name=li-eventsensor]").css("display", "none");
  635. $("[name=li-systemsystemmode]").css("display", "none");
  636. }
  637. if(boardid == 0x3004) {
  638. $("[name=li-record]").css("display", "none");
  639. }
  640. // Decoder Mode && Smooth Switching List Enable
  641. if((setup["SYS_MODE"] == 1) && (setup["SYS_IS_USE_SMOOTH_SW"] == 1)) {
  642. $("[name=li-networklist]").css("display", "");
  643. }
  644. else {
  645. $("[name=li-networklist]").css("display", "none");
  646. }
  647. }
  648. else if((boardid & 0xF000) == 0xB000){
  649. if(setup["SYS_ISIPCAM"] != 0){
  650. $("[name=li-systemsystemmode]").css("display", "none");
  651. }
  652. else{
  653. if ((boardid & 0xFFFF) == 0xB005) { // TCS-1600
  654. $("[name=li-systemsystemmode]").css("display", "none");
  655. }
  656. $("[name=li-imagegeneral]").css("display", "none");
  657. }
  658. // Decoder Mode && Smooth Switching List Enable
  659. if((setup["SYS_MODE"] == 1) && (setup["SYS_IS_USE_SMOOTH_SW"] == 1)) {
  660. $("[name=li-networklist]").css("display", "");
  661. }
  662. else {
  663. $("[name=li-networklist]").css("display", "none");
  664. }
  665. if(boardid == 0xB001) { // IPM-A400
  666. $("[name=li-videoaudio]").css("display", "none");
  667. $("[name=li-videooutput]").css("display", "none");
  668. $("[name=li-imageschedule]").css("display", "none");
  669. $("[name=li-eventsilence]").css("display", "none");
  670. $("[name=li-record]").css("display", "none");
  671. $("[name=li-device]").css("display", "none");
  672. $("[name=li-ptz]").css("display", "none");
  673. }
  674. }
  675. else if((boardid & 0xF000) == 0xD000 || (boardid & 0xF000) == 0xE000){
  676. $("[name=li-systemsystemmode]").css("display", "none");
  677. $("[name=li-networklist]").css("display", "none");
  678. $("[name=li-networkssl]").css("display", "none");
  679. if((boardid & 0xFFF000) == 0x10D000) { // Scale AQ
  680. $("[name=li-record]").css("display", "none");
  681. }
  682. }
  683. else{
  684. $("[name=li-systemsystemmode]").css("display", "none");
  685. $("[name=li-networklist]").css("display", "none");
  686. }
  687. $("[name=li-networkmulticast]").css("display", "none");
  688. if(boardid == 0x1003 || boardid == 0x1007){ // TCS-410
  689. $("[name=li-networkoneway]").css("display", "none");
  690. $("[name=li-ptzgroup]").css("display", "none");
  691. $("[name=li-ptzadvanced]").css("display", "none");
  692. $("[name=li-eventsilence]").css("display", "none");
  693. if(setup["SYS_IS_MULTICAST_SPECIFIC"] == 1){
  694. $("[name=li-networkmulticast]").css("display", "");
  695. }
  696. $("[name=li-ptzpositionosd]").css("display", "none");
  697. $("[name=li-imagemask]").css("display", "");
  698. }
  699. if((parseInt(setup["SYS_NOT_SUPPORT_FUNCTION"]) & parseInt(1<<PTZ_FUNCTION)) == parseInt(1<<PTZ_FUNCTION)){
  700. $("[name=li-ptz]").css("display", "none");
  701. $("[name=li-device]").css("display", "none");
  702. }
  703. else if(parseInt(setup["SYS_IS_FIR2"]) == 1){
  704. $("[name=li-device]").css("display", "none");
  705. }
  706. if((parseInt(setup["SYS_NOT_SUPPORT_FUNCTION"]) & parseInt(1<<RECORD_FUNCTION)) == parseInt(1<<RECORD_FUNCTION)){
  707. $("[name=li-record]").css("display", "none");
  708. }
  709. if(parseInt(setup["SYS_NUMOFSENSOR"]) == 0){
  710. $("[name=li-eventsensor]").css("display", "none");
  711. }
  712. if(parseInt(setup["SYS_NUMOFALARM"]) == 0){
  713. $("[name=li-eventalarm]").css("display", "none");
  714. }
  715. if((boardid & 0xF000) != 0x1000 && (boardid & 0xF000) != 0x3000 && (boardid & 0xF000) != 0xB000 && (boardid & 0xF000) != 0x5000 && (boardid & 0xF000) != 0x9000 && (boardid & 0xF000) != 0xA000 && (boardid & 0xF000) != 0xD000 && (boardid & 0xF000) != 0xE000 || mode != 0){
  716. $("[name=li-ptzpositionosd]").css("display", "none");
  717. }
  718. if((setup["SYS_IS_CTECNEW"] == 1 || setup["SYS_CYNIX_XIR"] == 1 || (setup["SYS_FTCAMERA"] == 1 && (boardid & 0x000F) == 0x0002 || boardid == 0x29000 || boardid == 0x49000 || boardid == 0x69000 || boardid == 0x89000 || boardid == 0x129000 || boardid == 0x11A004 || boardid == 0x12A004 || (boardid & 0xF0F00F) == 0x10B004) || (setup["SYS_IS_HOUSINGSPECIFIC"] == 1) || (moduletype == NXP_ISP_MODULE && ptztype == 1) || ((moduletype == HI_ISP_MODULE || moduletype == S5LM55_ISP_MODULE || moduletype == CV2_ISP_MODULE) && ptztype == 1 && (setup["SYS_ZOOMRATIO"] > 0x5)) || (moduletype == CV2_ISP_MODULE && ptztype == 7)) && (setup["SYS_IS_FIRHOUSING_SPECIFIC"] != 1)){
  719. }
  720. else{
  721. $("[name=li-imageircontrol]").css("display", "none");
  722. }
  723. if(moduletype == HI3519_ISP_MODULE && parseInt(setup["SYS_FTCAMERA_FA3"]) != 0)
  724. {
  725. $("[name=li-imageircontrol]").css("display", "none");
  726. }
  727. if(setup["VID_FAKE_DEMIST"] == 1 && moduledetail == MODULE_SONY_EH6300){
  728. }
  729. else{
  730. $("[name=li-imagedemist]").css("display", "none");
  731. }
  732. if(setup["SYS_IS_PLCSPECIFIC"] == 1){
  733. $("[name=li-ptzpositionosd]").css("display", "none");
  734. }
  735. else{
  736. $("[name=li-deviceplc]").css("display", "none");
  737. }
  738. if(setup["SYS_IS_BOOKISPECIFIC"] != 1){
  739. $("[name=li-devicebooki]").css("display", "none");
  740. }
  741. if(ptztype == 1 && (moduletype == 1 || moduletype == 2 || moduletype == 3 || moduletype == 4 || moduletype == 6 || moduletype == 9) ){
  742. }
  743. else{
  744. $("[name=li-devicefan]").css("display", "none");
  745. }
  746. if (moduletype != PANASONIC_MODULE && setup["SYS_USE_AUTO_PTZ"] != 1){
  747. $("[name=li-ptztracking]").css("display", "none");
  748. }
  749. if ((((setup["SYS_BOARDID"] & 0xF000) == 0x1000 || (setup["SYS_BOARDID"] & 0xF000) == 0x4000 || (setup["SYS_BOARDID"] & 0xF000) == 0x5000 || (setup["SYS_BOARDID"] & 0xF000) == 0x6000 || (setup["SYS_BOARDID"] & 0xF000) == 0x9000 || (setup["SYS_BOARDID"] & 0xF000) == 0xA000) && (setup["SYS_ISIPCAM"] == 1)) ||
  750. ((setup["SYS_BOARDID"] & 0xF000) == 0xB000 || (setup["SYS_BOARDID"] & 0xF000) == 0xD000 || (setup["SYS_BOARDID"] & 0xF000) == 0xE000)){
  751. if(parseInt(setup["VA_LicenseValid"]) == 1){
  752. $("[name=li-eventva]").css("display", "");
  753. }
  754. else{
  755. $("[name=li-eventva]").css("display", "none");
  756. }
  757. }
  758. else{
  759. $("[name=li-eventva]").css("display", "none");
  760. }
  761. if (setup["SYS_IS_IIST_SPECIFIC"] == 1) {
  762. $("[name=li-eventflamedetection]").css("display", "");
  763. } else {
  764. $("[name=li-eventflamedetection]").css("display", "none");
  765. }
  766. if( ((boardid & 0xF000) == 0x4000 || (boardid & 0xF000) == 0x6000 || boardid == 0x1003 || boardid == 0x1007) ||
  767. mode == 1) {
  768. $("[name=li-eventosd]").css("display", "none");
  769. }
  770. if(boardid == 0x1003 || boardid == 0x1007) {
  771. $("[name=li-eventhttpaction]").css("display", "none");
  772. }
  773. if((boardid == 0x1A002 || boardid == 0x2A002 || boardid == 0x3A002 || boardid == 0x4A002 || boardid == 0x5A002 || boardid == 0x6A002 || boardid == 0xB003 || boardid == 0x1B003 || boardid == 0x2B003) && (setup["SYS_IS_FIRHOUSING_SPECIFIC"] != 1)) {
  774. $("[name=li-imageircontrol]").css("display", "");
  775. }
  776. // if((moduletype == NXP_ISP_MODULE || moduletype == HI_ISP_MODULE || moduletype == HI3519_ISP_MODULE) && ptztype == 1){
  777. // $("[name=li-imagemask]").css("display", "none");
  778. // }
  779. if(setup["SYS_IS_RAPIER_SPECIFIC"] == 1){
  780. $("[name=li-image]").css("display", "none");
  781. $("[name=li-ptzpositionosd]").css("display", "none");
  782. }
  783. if(setup["SYS_IS_SEMOCON_SPECIFIC"] == 1){
  784. $("[name=li-devicehousing]").css("display", "");
  785. $("[name=li-ptzpattern]").css("display", "");
  786. // $("[name=li-imagemask]").css("display", "none");
  787. // $("[name=li-ptzpositionosd]").css("display", "none");
  788. }
  789. else {
  790. $("[name=li-devicehousing]").css("display", "none");
  791. }
  792. if(setup["SYS_IS_FIRHOUSING_SPECIFIC"] == 1){
  793. $("[name=li-deviceirhousing]").css("display", "");
  794. $("[name=li-ptzgeneral]").css("display", "none");
  795. } else {
  796. $("[name=li-deviceirhousing]").css("display", "none");
  797. }
  798. if(parseInt(setup["SYS_GDS_DISABLE"]) == 1){
  799. $("[name=li-networkgoogledrive]").css("display", "none");
  800. }
  801. if(parseInt(setup["SYS_LPR_ITSTECH"]) == 1 ||
  802. parseInt(setup["SYS_USE_LPR"]) == 1 ||
  803. parseInt(setup["SYS_USE_GIT_LPR"]) == 1){
  804. $("[name=li-eventlpr]").css("display", "");
  805. }
  806. else{
  807. $("[name=li-eventlpr]").css("display", "none");
  808. }
  809. if(setup["SYS_IS_OBJECT_DETECT"] == 1) {
  810. $("[name=li-eventobjectdetection]").css("display", "");
  811. }
  812. else {
  813. $("[name=li-eventobjectdetection]").css("display", "none");
  814. }
  815. if(setup["SYS_FTCAMERA_IR4"] != 3 && setup["SYS_FTCAMERA_IR4"] != 4){
  816. $("[name=li-devicewiper]").css("display", "none");
  817. }
  818. if( ((boardid & 0xF000) == 0x9000 || (boardid & 0xF000) == 0xA000 || (boardid & 0xF000) == 0xB000 ) && (setup["SYS_FTCAMERA_IR4"] == 4) ) {
  819. // if( ((boardid & 0xF000) == 0x9000 || (boardid & 0xF000) == 0xA000 || (boardid & 0xF000) == 0xB000 ) && ( (setup["SYS_FTCAMERA_IR4"] == 4) || (setup["SYS_FTCAMERA_IR4"] == 3) || (setup["SYS_FTCAMERA_IR4"] == 2)) ) {
  820. $("[name=li-systemdirectioncamera]").css("display", "");
  821. }
  822. else {
  823. $("[name=li-systemdirectioncamera]").css("display", "none");
  824. }
  825. if(setup["SYS_ISIPCAM"] == 0){
  826. $("[name=li-ptzextptz]").css("display", "none");
  827. }
  828. else if(((boardid & 0xF000) == 0x1000 || (boardid & 0xF000) == 0x5000) && ptztype != 1 && ptztype != 7){
  829. $("[name=li-ptzextptz]").css("display", "");
  830. }
  831. else if(moduletype == NXP_ISP_MODULE && ptztype == 1){
  832. $("[name=li-ptzextptz]").css("display", "");
  833. }
  834. else if((moduletype == HI_ISP_MODULE || moduletype == HI3519_ISP_MODULE || moduletype == HI3519A_ISP_MODULE) && ptztype == 1){
  835. $("[name=li-ptzextptz]").css("display", "");
  836. }
  837. else if((moduletype == S5LM55_ISP_MODULE || moduletype == CV2_ISP_MODULE) && ptztype == 1){
  838. $("[name=li-ptzextptz]").css("display", "");
  839. }
  840. else{
  841. $("[name=li-ptzextptz]").css("display", "none");
  842. }
  843. if(parseInt(setup["SYS_WIFI_DEVICEDETECT"]) != 1){
  844. $("[name=li-networkwifi]").css("display", "none");
  845. }
  846. if(setup["SYS_CLOUD_INTERCONNECTION"] != 1){
  847. $("[name=li-networkcloud]").css("display", "none");
  848. }
  849. if(parseInt(setup["SYS_FIXEDMASK_TEMPORARY"]) != 1){
  850. $("[name=li-imagemask2]").css("display", "none");
  851. }
  852. if(parseInt(setup["SYS_ILLUMINATOR"]) != 1) {
  853. $("[name=li-deviceilluminator]").css("display", "none");
  854. }
  855. if(parseInt(setup["SYS_RTU_SPECIFIC"]) != 1) {
  856. $("[name=li-devicertu]").css("display", "none");
  857. }
  858. if(parseInt(setup["SYS_SHOCK_SENSOR_EXIST"]) != 1) {
  859. $("[name=li-eventshock]").css("display", "none");
  860. }
  861. if(parseInt(setup["SYS_NEWLOG"]) != 1) {
  862. $("[name=li-systemlog]").css("display", "none");
  863. }
  864. if(mode == 0 && parseInt(setup["SYS_USE_LIVE555"]) == 1) {
  865. } else {
  866. $("[name=li-networkrtspmulticast]").css("display", "none");
  867. }
  868. if(parseInt(setup["SYS_TTA_SECURITY_VERIFIED"]) == 1) {
  869. $("[name=li-networksnmp]").css("display", "none");
  870. }
  871. if(mode == 1 || parseInt(setup["SYS_USE_SRT"]) != 1) {
  872. $("[name=li-networksrt]").css("display", "none");
  873. }
  874. if(boardid == 0x3D011 || boardid == 0x4D011 || boardid == 0x5D011 || boardid == 0x6D011 || boardid == 0x9D011) { // S5L TN
  875. }
  876. else {
  877. $("[name=li-networklink]").css("display", "none");
  878. }
  879. if(ptztype != 7 || parseInt(setup["SYS_INTELLIGENT_PTZ"]) != 1) {
  880. $("[name=li-ptzintelligent]").css("display", "none");
  881. }
  882. if(boardid == 0x1003 || boardid == 0x1007) { // TCS-410
  883. $("[name=li-eventuserdefinedevent]").css("display", "none");
  884. }
  885. if(setup["SYS_ISIPCAM"] == 1) {
  886. $("[name=li-deviceled]").css("display", "none");
  887. }
  888. if((boardid & 0xFFFF) == 0xB000 || (boardid & 0xFFFF) == 0xB005) { // TCS-8500 or TCS-1600
  889. $("[name=li-deviceled]").css("display", "none");
  890. if(boardid == 0x1B000) { // TCS-8500A
  891. $("[name=li-device]").css("display", "none");
  892. }
  893. }
  894. if(boardid == 0xB001) {
  895. $("[name=li-systemtiltposition]").css("display", "");
  896. $("[name=li-systemexttracking]").css("display", "");
  897. } else {
  898. $("[name=li-systemtiltposition]").css("display", "none");
  899. $("[name=li-systemexttracking]").css("display", "none");
  900. }
  901. if(setup["SYS_IS_DATATOYS_SPECIFIC"] == 1) {
  902. $("[name=li-deviceled]").css("display", "none");
  903. }
  904. if(setup["SYS_USE_GIT_LPR"] == 1) {
  905. $("[name=li-systemaudiofile]").css("display", "");
  906. } else {
  907. $("[name=li-systemaudiofile]").css("display", "none");
  908. }
  909. if(setup["SYS_IS_JIINTECH_SPECIFIC"] == 1) {
  910. $("[name=li-systemcrimemanager]").css("display", "");
  911. } else {
  912. $("[name=li-systemcrimemanager]").css("display", "none");
  913. }
  914. if(setup["SYS_IS_KEXMOLIT_SPEC"] == 1) {
  915. $("[name=li-systemmolit]").css("display", "");
  916. } else {
  917. $("[name=li-systemmolit]").css("display", "none");
  918. }
  919. if(setup["SYS_IS_AVEC_PTHOUSING_SPECIFIC"] == 1) {
  920. $("[name=li-imagemask]").css("display", "none");
  921. }
  922. if(setup["SYS_IS_HATTLELAND_SPEC"] == 1){
  923. $("[name=li-videoaudio]").css("display", "none");
  924. $("[name=li-eventsilence]").css("display", "none");
  925. $("[name=li-eventsensor]").css("display", "none");
  926. $("[name=li-eventva]").css("display", "none");
  927. $("[name=li-eventosd]").css("display", "none");
  928. $("[name=li-ptz]").css("display", "none");
  929. $("[name=li-videooutput]").css("display", "none");
  930. $("[name=li-device]").css("display", "none");
  931. $("[name=li-eventhttpaction]").css("display", "none");
  932. }
  933. if(setup["SYS_REMOVE_DDNS"] == 1) {
  934. $("[name=li-networkddns]").css("display", "none");
  935. }
  936. }
  937. function isSupportMenu(menu)
  938. {
  939. for(i = 0; i < T_SupportMenu.length; i++) {
  940. if(menu == T_SupportMenu[i])
  941. return true;
  942. }
  943. return false;
  944. }
  945. /*
  946. function applyLanguage(lid)
  947. {
  948. var table;
  949. var locale = [ "English", "Japanese", "Korean", ];
  950. table = ajaxGet("/resources/lang/LT_" + locale[lid] + ".tlf.json");
  951. if(table) {
  952. //console.log(table);
  953. LT = eval('(' + table + ')');
  954. for(var i = 0; i < LT.length; i++) {
  955. // IE9에서는 LT.length가 Chrome이나 FF보다 1더 많이 넘어온다.
  956. // 이를 해결하기 위해 null 체크
  957. if(LT[i] == null)
  958. break;
  959. $(".LAN_" + LT[i].id).text(LT[i].str);
  960. //console.log("#" + LT[i].id + " = " + LT[i].str);
  961. }
  962. }
  963. }
  964. */
  965. function initLanguage()
  966. {
  967. var table;
  968. var locale = [ "English", "Japanese", "Korean", "Hebrew", "Russian", "Spanish", "Portuguese" , "Chinese", "German" , "Arabic", "Finnish", "Italian" , "Polish", "French", "Czech" , "Chinese_tw", "Turkish", "Dutch"];
  969. LID = readSetupByKey("SYS_LANGUAGE");
  970. table = ajaxGet("/resources/lang/LT_" + locale[LID] + ".tlf.json");
  971. if(table) {
  972. //console.log(table);
  973. LT = eval('(' + table + ')');
  974. if(1){
  975. $("[class*='LAN_']").each(function(i, d) {
  976. // n = n + 1;
  977. //console.log(d.className);
  978. var caption = d.className;
  979. id = parseInt(caption.substr(caption.indexOf("LAN_") + 4, 4), 10);
  980. $(this).text(LT[id].str);
  981. });
  982. }
  983. else{
  984. // 기존 로직
  985. for(var i = 0; i < LT.length; i++) {
  986. if(LT[i] == null)
  987. break;
  988. $(".LAN_" + LT[i].id).text(LT[i].str);
  989. }
  990. }
  991. }
  992. }
  993. function initLanguage2()
  994. {
  995. var table;
  996. var locale = [ "English", "Japanese", "Korean", "Hebrew", "Russian", "Spanish", "Portuguese" , "Chinese", "German" , "Arabic", "Finnish", "Italian" , "Polish", "French", "Czech" , "Chinese_tw", "Turkish", "Dutch"];
  997. LID = readSetupByKey("SYS_LANGUAGE");
  998. table = ajaxGet("/resources/lang/LT_" + locale[LID] + ".tlf.json");
  999. if(table) {
  1000. //console.log(table);
  1001. LT = eval('(' + table + ')');
  1002. // $("[name^='LAN_']").text(LT[parseInt($(this).text())].str);
  1003. $("[name^='LAN_']").text(function(){
  1004. // alert("xxx=" + parseInt($(this).text()));
  1005. return LT[parseInt($(this).text())].str;
  1006. });
  1007. }
  1008. }
  1009. function GetLan(index)
  1010. {
  1011. return LT[index].str;
  1012. }
  1013. /*
  1014. function T_GetLangString(key)
  1015. {
  1016. var id = key.slice(4);
  1017. console.log("key = " + key + " id = " + id);
  1018. for(i = 0; i < LT.length; i++) {
  1019. if(LT[i].id == id)
  1020. return LT[i].str;
  1021. }
  1022. return undefined;
  1023. }
  1024. */
  1025. /*****************************************************************************/
  1026. var PRODUCT = "truen";
  1027. var LID = 2;
  1028. /*****************************************************************************/
  1029. function T_LoadSetup(page)
  1030. {
  1031. var setup = readSetupByPage(page);
  1032. $(":input").each(function(index, obj) {
  1033. //console.log("name = " + $(this).prop("name") + " type = " + $(this).prop("type"));
  1034. if($(this).prop("name") != undefined){
  1035. if(setup[$(this).prop("name")] != undefined){
  1036. if($(this).prop("type") == "checkbox") {
  1037. if(setup[$(this).prop("name")] == "0")
  1038. $(this).prop("checked", false);
  1039. else
  1040. $(this).prop("checked", true);
  1041. }
  1042. else if($(this).prop("type") == "radio") {
  1043. if($(this).val() == setup[$(this).prop("name")])
  1044. $(this).prop("checked", true);
  1045. else
  1046. $(this).prop("checked", false);
  1047. }
  1048. else if($(this).prop("type") == "select-one") {
  1049. var value = setup[$(this).prop("name")];
  1050. $(this).find("option").filter(function() {
  1051. return $(this).val() == value;
  1052. }).prop("selected", true);
  1053. }
  1054. else if($(this).prop("type") == "textarea") {
  1055. $(this).val(setup[$(this).prop("name")]);
  1056. }
  1057. else {
  1058. $(this).val(setup[$(this).prop("name")]);
  1059. }
  1060. }
  1061. }
  1062. });
  1063. $("span").each(function(index, obj) {
  1064. if($(this).attr("name") != undefined){
  1065. if(setup[$(this).attr("name")] != undefined){
  1066. $(this).text(setup[$(this).attr("name")]);
  1067. }
  1068. }
  1069. });
  1070. }
  1071. function T_ApplySetup(formId, prefix)
  1072. {
  1073. var message = "";
  1074. if(formId == undefined)
  1075. formFilter = "";
  1076. else
  1077. formFilter = "form[id=" + formId + "] ";
  1078. $(formFilter + ":input[name^=" + prefix + "]").each(function(index, obj) {
  1079. if(!$(this).readOnly && !$(this).disabled) {
  1080. if($(this).prop("type") == "radio") {
  1081. if($(this).prop("checked")) {
  1082. var tmp = encodeURIComponent($(this).prop("name")) + "=" + $(this).val() + "&";
  1083. message += tmp;
  1084. }
  1085. }
  1086. else if($(this).prop("type") == "checkbox") {
  1087. var tmp = encodeURIComponent($(this).prop("name")) + "=";
  1088. if($(this).prop("checked")) {
  1089. tmp += "1&";
  1090. }
  1091. else {
  1092. tmp += "0&";
  1093. }
  1094. message += tmp;
  1095. }
  1096. else if($(this).prop("type") == "select-one") {
  1097. var tmp = encodeURIComponent($(this).prop("name")) + "=" + encodeURIComponent($(this).val()) + "&";
  1098. message += tmp;
  1099. }
  1100. else if($(this).prop("type") == "textarea") {
  1101. var tmp = encodeURIComponent($(this).prop("name")) + "=" + encodeURIComponent($(this).val()) + "&";
  1102. message += tmp;
  1103. }
  1104. else if($(this).prop("type") == "text") {
  1105. var tmp = encodeURIComponent($(this).prop("name")) + "=" + encodeURIComponent($(this).val()) + "&";
  1106. message += tmp;
  1107. }
  1108. else if($(this).prop("type") == "password") {
  1109. var tmp = encodeURIComponent($(this).prop("name")) + "=" + encodeURIComponent($(this).val()) + "&";
  1110. message += tmp;
  1111. }
  1112. else if($(this).prop("type") == "hidden") {
  1113. var tmp = encodeURIComponent($(this).prop("name")) + "=" + encodeURIComponent($(this).val()) + "&";
  1114. message += tmp;
  1115. }
  1116. }
  1117. });
  1118. // console.log("[MSG] = [" + message + "]");
  1119. writeSetup(message);
  1120. }
  1121. function T_SelectMenu(product, menu)
  1122. {
  1123. url = "/product/" + product + "/" + menu + ".html";
  1124. var boardid = readSetupByKey("SYS_BOARDID");
  1125. if(boardid == 0x1003 || boardid == 0x1007){
  1126. if(menu == "systemsystemid" || menu == "imagegeneral" || menu == "imagemask" || menu == "videoinformation" || menu == "videoencode" || menu == "ptzgeneral" || menu == "ptzpreset" || menu == "eventmotion" || menu == "eventnotification" || menu == "recordgeneral" || menu == "recordschedule" || menu == "networkftp"){
  1127. url = "/product/" + product + "/" + menu + "_410.html";
  1128. }
  1129. }
  1130. else if(boardid == 0xB001){
  1131. if(menu == "systemsystemid" || menu == "videoinformation" || menu == "videoencode" || menu == "imagegeneral" || menu == "imagemask" || menu == "eventnotification" || menu == "networkftp" || menu == "networkrtspmulticast" || menu == "networkoneway" || menu == "networksrt" || menu == "eventmotion" || menu == "eventva" || menu == "eventuserdefinedevent"){
  1132. url = "/product/" + product + "/" + menu + "_a400.html";
  1133. }
  1134. }
  1135. else{
  1136. if(menu == "imagegeneral"){
  1137. var val = readSetupByKey("SYS_MODULE_TYPE");
  1138. var ipcam = readSetupByKey("SYS_ISIPCAM");
  1139. if(ipcam == 0){
  1140. url = "/product/" + product + "/" + menu + "_server.html";
  1141. }
  1142. else{
  1143. if(val == NEXT_MODULE){
  1144. url = "/product/" + product + "/" + menu + "_eagle.html";
  1145. }
  1146. else if(val == SONY_MODULE){
  1147. url = "/product/" + product + "/" + menu + "_sony.html";
  1148. }
  1149. else if(val == PANASONIC_MODULE){
  1150. url = "/product/" + product + "/" + menu + "_panasonic.html";
  1151. }
  1152. else if(val == TECHWIN_MODULE){
  1153. url = "/product/" + product + "/" + menu + "_techwin.html";
  1154. }
  1155. else if(val == HITACHI_MODULE){
  1156. url = "/product/" + product + "/" + menu + "_hitachi.html";
  1157. }
  1158. else if(val == LG_MODULE){
  1159. url = "/product/" + product + "/" + menu + "_lg.html";
  1160. }
  1161. else if(val == SONYIS_MODULE){
  1162. url = "/product/" + product + "/" + menu + "_imx103.html";
  1163. }
  1164. else if(val == WONWOO_MODULE){
  1165. url = "/product/" + product + "/" + menu + "_wonwoo.html";
  1166. }
  1167. else if(val == CYNIX_MODULE){
  1168. url = "/product/" + product + "/" + menu + "_cynix.html";
  1169. }
  1170. else if(val == POWERVIEW_MODULE){
  1171. url = "/product/" + product + "/" + menu + "_powerview.html";
  1172. }
  1173. else if(val == NXP_ISP_MODULE) {
  1174. url = "/product/" + product + "/" + menu + "_nxp.html";
  1175. }
  1176. else if(val == AMBA_ISP_MODULE) {
  1177. url = "/product/" + product + "/" + menu + "_amba.html";
  1178. }
  1179. else if(val == HI_ISP_MODULE) {
  1180. url = "/product/" + product + "/" + menu + "_hi.html";
  1181. }
  1182. else if(val == HI3519_ISP_MODULE) {
  1183. url = "/product/" + product + "/" + menu + "_hi.html";
  1184. }
  1185. else if(val == HI3519A_ISP_MODULE) {
  1186. url = "/product/" + product + "/" + menu + "_hi.html";
  1187. }
  1188. else if(val == S5LM55_ISP_MODULE) {
  1189. url = "/product/" + product + "/" + menu + "_s5l.html"; // TODO: check
  1190. }
  1191. else if(val == CV2_ISP_MODULE) {
  1192. url = "/product/" + product + "/" + menu + "_cv2.html"; // TODO: check
  1193. }
  1194. }
  1195. }
  1196. if(menu == "imagemask"){
  1197. var val = readSetupByKey("SYS_MODULE_TYPE");
  1198. var detail = readSetupByKey("SYS_MODULE_DETAIL");
  1199. var ptz = readSetupByKey("SYS_PTZ_TYPE");
  1200. if(val == NEXT_MODULE){
  1201. if(readSetupByKey("SYS_IS_SEMOCON_SPECIFIC") == 1){
  1202. url = "/product/" + product + "/" + menu + "_zoom.html";
  1203. }
  1204. else{
  1205. url = "/product/" + product + "/" + menu + "_box.html";
  1206. }
  1207. }
  1208. else if(val == SONYIS_MODULE){
  1209. url = "/product/" + product + "/" + menu + "_box.html";
  1210. }
  1211. else if (detail == MODULE_SONY_SE600 || detail == MODULE_PACIFIC_20 || detail == MODULE_SONY_EH6300 || detail == MODULE_SONY_EH6500 || detail == MODULE_SONY_EV7500 || detail == MODULE_SONY_EV7300 || detail == MODULE_SONY_EV7310 || detail == MODULE_SONY_EV7520 || detail == MODULE_SONY_EV7520A || detail == MODULE_SONY_EV7320 || detail == MODULE_SONY_EV7517 || detail == MODULE_SONY_EV7317 || detail == MODULE_SONY_ER8300 || (val == HITACHI_MODULE && ptz == 7) || val == TECHWIN_MODULE || val == LG_MODULE || val == PANASONIC_MODULE || val == WONWOO_MODULE || val == CYNIX_MODULE || val == POWERVIEW_MODULE){
  1212. url = "/product/" + product + "/" + menu + "_zoom.html";
  1213. }
  1214. else if (val == NXP_ISP_MODULE)
  1215. {
  1216. if(ptz == 1){
  1217. url = "/product/" + product + "/" + menu + "_zoom.html";
  1218. }
  1219. else{
  1220. url = "/product/" + product + "/" + menu + "_ti.html";
  1221. }
  1222. }
  1223. else if (val == HI3519_ISP_MODULE)
  1224. {
  1225. var is_ptz_micom = readSetupByKey("SYS_IS_TRUEN_PTZ_MICOM");
  1226. if(is_ptz_micom != 0){
  1227. url = "/product/" + product + "/" + menu + "_zoom.html";
  1228. }
  1229. else{
  1230. if(ptz == 1)
  1231. {
  1232. if(readSetupByKey("SYS_USE_POLYGONMASK") == 1){
  1233. url = "/product/" + product + "/" + menu + "_polygon.html"; // TODO: check
  1234. } else {
  1235. url = "/product/" + product + "/" + menu + "_zoom.html";
  1236. }
  1237. }
  1238. else
  1239. {
  1240. url = "/product/" + product + "/" + menu + "_ti.html";
  1241. }
  1242. }
  1243. }
  1244. else if (val == HI_ISP_MODULE || val == HI3519A_ISP_MODULE)
  1245. {
  1246. var is_ptz_micom = readSetupByKey("SYS_IS_TRUEN_PTZ_MICOM");
  1247. var mosaic = readSetupByKey("SYS_USE_MOSAIC_MASK");
  1248. if(is_ptz_micom != 0){
  1249. if(mosaic == 1) {
  1250. url = "/product/" + product + "/" + menu + "_mosaic.html";
  1251. } else {
  1252. url = "/product/" + product + "/" + menu + "_zoom.html";
  1253. }
  1254. }
  1255. else {
  1256. if(ptz == 1){
  1257. url = "/product/" + product + "/" + menu + "_zoom.html";
  1258. }
  1259. else{
  1260. if(readSetupByKey("SYS_IS_SEMOCON_SPECIFIC") == 1){
  1261. url = "/product/" + product + "/" + menu + "_zoom.html";
  1262. }
  1263. else{
  1264. url = "/product/" + product + "/" + menu + "_ti.html";
  1265. }
  1266. }
  1267. }
  1268. }
  1269. else if (val == S5LM55_ISP_MODULE)
  1270. {
  1271. if (ptz == 1)
  1272. {
  1273. if(readSetupByKey("SYS_USE_POLYGONMASK") == 1){
  1274. url = "/product/" + product + "/" + menu + "_polygon.html"; // TODO: check
  1275. } else {
  1276. url = "/product/" + product + "/" + menu + "_zoom.html"; // TODO: check
  1277. }
  1278. }
  1279. else
  1280. {
  1281. url = "/product/" + product + "/" + menu + "_ti.html"; // TODO: check
  1282. }
  1283. }
  1284. else if (val == CV2_ISP_MODULE)
  1285. {
  1286. if(is_ptz_micom != 0){
  1287. if(readSetupByKey("SYS_USE_POLYGONMASK") == 1){
  1288. url = "/product/" + product + "/" + menu + "_polygon.html"; // TODO: check
  1289. } else {
  1290. url = "/product/" + product + "/" + menu + "_zoom.html"; // TODO: check
  1291. }
  1292. } else {
  1293. if (ptz == 1)
  1294. {
  1295. url = "/product/" + product + "/" + menu + "_zoom.html"; // TODO: check
  1296. }
  1297. else
  1298. {
  1299. url = "/product/" + product + "/" + menu + "_ti.html"; // TODO: check
  1300. }
  1301. }
  1302. }
  1303. else if(val == AMBA_ISP_MODULE)
  1304. {
  1305. url = "/product/" + product + "/" + menu + "_ti.html";
  1306. }
  1307. else if(readSetupByKey("SYS_ISIPCAM") == 0 && ((readSetupByKey("SYS_BOARDID") & 0xF000) == 0x3000 || (readSetupByKey("SYS_BOARDID") & 0xF000) == 0xB000))
  1308. {
  1309. url = "/product/" + product + "/" + menu + "_ti.html";
  1310. }
  1311. }
  1312. if(menu == "imageircontrol"){
  1313. var is_ptz_micom = readSetupByKey("SYS_IS_TRUEN_PTZ_MICOM");
  1314. var module_type = readSetupByKey("SYS_MODULE_TYPE");
  1315. var sys_ftcamera = readSetupByKey("SYS_FTCAMERA");
  1316. var sys_ftcamera_ir4 = readSetupByKey("SYS_FTCAMERA_IR4");
  1317. var sys_ftcamera_nline = readSetupByKey("SYS_FTCAMERA_NLINE");
  1318. var sys_ftcamera_hwversion = readSetupByKey("SYS_FTCAMERA_HWVERSION");
  1319. if(readSetupByKey("SYS_IS_CTECNEW") == 1){
  1320. }
  1321. else if(readSetupByKey("SYS_CYNIX_XIR") == 1){
  1322. url = "/product/" + product + "/" + menu + "_xir.html";
  1323. }
  1324. else if(sys_ftcamera == 1 && (readSetupByKey("SYS_BOARDID") & 0x000F) == 0x0002 || (readSetupByKey("SYS_BOARDID") & 0xF00F) == 0xB004){
  1325. if(sys_ftcamera_ir4 != 0){
  1326. if((sys_ftcamera_ir4 == 4 && sys_ftcamera_hwversion == 1) || (sys_ftcamera_ir4 == 2 && sys_ftcamera_nline == 1))
  1327. {
  1328. url = "/product/" + product + "/" + menu + "_fir_laser.html";
  1329. }
  1330. else{
  1331. url = "/product/" + product + "/" + menu + "_fir4.html";
  1332. }
  1333. }
  1334. else{
  1335. url = "/product/" + product + "/" + menu + "_fir.html";
  1336. }
  1337. }
  1338. else if(module_type == HI3519_ISP_MODULE)
  1339. {
  1340. if(is_ptz_micom != 0)
  1341. {
  1342. if(sys_ftcamera == 1 && sys_ftcamera_ir4 != 0)
  1343. {
  1344. url = "/product/" + product + "/" + menu + "_fir4.html";
  1345. }
  1346. else{
  1347. url = "/product/" + product + "/" + menu + "_fir.html";
  1348. }
  1349. }
  1350. else
  1351. {
  1352. url = "/product/" + product + "/" + menu + "_nxpisp.html";
  1353. }
  1354. }
  1355. else if(module_type == S5LM55_ISP_MODULE)
  1356. {
  1357. url = "/product/" + product + "/" + menu + "_nxpisp.html";
  1358. }
  1359. else if(module_type == CV2_ISP_MODULE)
  1360. {
  1361. if(is_ptz_micom != 0)
  1362. {
  1363. if(sys_ftcamera == 1 && sys_ftcamera_ir4 != 0)
  1364. {
  1365. if((sys_ftcamera_ir4 == 4 && sys_ftcamera_hwversion == 1) || (sys_ftcamera_ir4 == 2 && sys_ftcamera_nline == 1))
  1366. {
  1367. url = "/product/" + product + "/" + menu + "_fir_laser.html";
  1368. }
  1369. else {
  1370. url = "/product/" + product + "/" + menu + "_fir4.html";
  1371. }
  1372. }
  1373. else{
  1374. url = "/product/" + product + "/" + menu + "_fir.html";
  1375. }
  1376. }
  1377. else
  1378. {
  1379. url = "/product/" + product + "/" + menu + "_nxpisp.html";
  1380. }
  1381. }
  1382. if(readSetupByKey("SYS_IS_HOUSINGSPECIFIC") == 1){
  1383. var val = readSetupByKey("SYS_MODULE_TYPE");
  1384. if(val == NEXT_MODULE || val == SONYIS_MODULE){
  1385. url = "/product/" + product + "/" + menu + "_housingeagle.html";
  1386. }
  1387. else{
  1388. url = "/product/" + product + "/" + menu + "_housing.html";
  1389. }
  1390. }
  1391. if(module_type == NXP_ISP_MODULE || module_type == HI_ISP_MODULE){
  1392. url = "/product/" + product + "/" + menu + "_nxpisp.html";
  1393. }
  1394. if(module_type == HI3519A_ISP_MODULE && (readSetupByKey("SYS_BOARDID") & 0xF00F) == 0xB003){
  1395. url = "/product/" + product + "/" + menu + "_nxpisp.html";
  1396. }
  1397. }
  1398. if(menu == "videoinformation"){
  1399. if(parseInt(readSetupByKey("VID_MAX_STREAM_OF_ONE_CHANNEL")) == 2)
  1400. {
  1401. url = "/product/" + product + "/" + menu + "_2sub.html";
  1402. }
  1403. else if(readSetupByKey("SYS_MODE") != 0){ // decoder system
  1404. url = "/product/" + product + "/" + menu + "_dec.html";
  1405. }
  1406. }
  1407. if(menu == "videoencode"){
  1408. if(parseInt(readSetupByKey("VID_MAX_STREAM_OF_ONE_CHANNEL")) == 2)
  1409. {
  1410. url = "/product/" + product + "/" + menu + "_2sub.html";
  1411. }
  1412. }
  1413. if(menu == "videoaudio") {
  1414. if((parseInt(boardid) & 0xF000) == 0x3000 || (parseInt(boardid) & 0xF000) == 0xB000)
  1415. url = "/product/" + product + "/" + menu + "_3500.html";
  1416. }
  1417. if(menu == "networkddns"){
  1418. if(parseInt(readSetupByKey("SYS_COMMAX_DDNS")) == 1)
  1419. {
  1420. url = "/product/" + product + "/" + menu + "_commax.html";
  1421. }
  1422. }
  1423. if(menu == "ptzpositionosd"){
  1424. if(parseInt(readSetupByKey("SYS_IS_PVOSD_EXTENSION")) == 1)
  1425. {
  1426. url = "/product/" + product + "/" + menu + "_ex.html";
  1427. }
  1428. }
  1429. if(menu == "ptztracking"){
  1430. if(parseInt(readSetupByKey("SYS_IS_OBJECT_DETECT")) == 1)
  1431. {
  1432. url = "/product/" + product + "/" + menu + "_od.html";
  1433. }
  1434. }
  1435. if(menu == "eventnotification") {
  1436. if(boardid == 0x3003)
  1437. url = "/product/" + product + "/" + menu + "_3500d.html";
  1438. }
  1439. if(menu == "systemsystemid") {
  1440. if(readSetupByKey("SYS_OSD_PREVIEW") == 1) {
  1441. url = "/product/" + product + "/" + menu + "_preview.html";
  1442. }
  1443. }
  1444. if(menu == "networkftp") {
  1445. if(readSetupByKey("SYS_IS_BNB_SPECIFIC") == 1) {
  1446. url = "/product/" + product + "/" + menu + "_bnb.html";
  1447. }
  1448. }
  1449. }
  1450. if (menu == "eventlpr") {
  1451. if(readSetupByKey("SYS_USE_LPR") == 1) {
  1452. url = "/product/" + product + "/" + menu + "2.html";
  1453. }
  1454. if(readSetupByKey("SYS_USE_GIT_LPR") == 1){
  1455. url = "/product/" + product + "/" + menu + "git.html";
  1456. }
  1457. }
  1458. if (menu == "eventobjectdetection") {
  1459. if(readSetupByKey("SYS_IS_OBJECT_DETECT") == 1) {
  1460. url = "/product/" + product + "/" + menu + ".html";
  1461. }
  1462. }
  1463. if((readSetupByKey("SYS_IS_HATTLELAND_SPEC")) == 1){
  1464. $(".LAN_686").attr('class', 'LAN_031');
  1465. }
  1466. contents = ajaxGet(url);
  1467. $("#TSetupContents").html(contents);
  1468. // set
  1469. $("a#" + menu).parent().parent().parent(".menuWrap").addClass("on");
  1470. $("a#" + menu).addClass("on");
  1471. $("a#" + menu).children("img").attr("src", "/resources/img/btn45_N.gif");
  1472. }
  1473. function T_LoadSetupItem(name)
  1474. {
  1475. contents = ajaxGet("/setup-item/" + name + ".html");
  1476. $("#TSetupItemList").append(contents);
  1477. }
  1478. function T_LiveInit(product)
  1479. {
  1480. alert("T_LiveInit");
  1481. }
  1482. function T_SetupInit(menu)
  1483. {
  1484. //loadModel();
  1485. loadSetupTemplate(PRODUCT);
  1486. if(!isSupportMenu(menu)) {
  1487. alert("TODO: 지원하지 않는 페이지일 경우 redirect 해야 한다.");
  1488. }
  1489. T_SelectMenu(PRODUCT, menu);
  1490. initLoading();
  1491. if(startSetup() == undefined) {
  1492. initLanguage();
  1493. beautify();
  1494. }
  1495. if(SUPPORT_MULTI_DEVICE_DETECTION_CAM_TYPE == support_multi_device_type) {
  1496. $("[name=subcam-text]").text(GetLan(1060));
  1497. $("[name=maincam-text]").text(GetLan(1064));
  1498. }
  1499. else if(SUPPORT_MULTI_DEVICE_PTZ_TYPE == support_multi_device_type) {
  1500. $("[name=subcam-text]").text(GetLan(1064));
  1501. $("[name=maincam-text]").text(GetLan(1060));
  1502. }
  1503. else {
  1504. ;
  1505. }
  1506. contents = ajaxGet("/resources/oem/title.html");
  1507. if(contents){
  1508. document.title = contents;
  1509. // $("#page_title").html(contents);
  1510. }
  1511. else{
  1512. document.title = readSetupByKey("SYS_SYSTEMID");
  1513. if(document.title == ""){
  1514. document.title = "Video Surveillance";
  1515. }
  1516. }
  1517. contents = ajaxGet("/resources/oem/url.html");
  1518. if(!contents){
  1519. contents = ajaxGet("/bitmap/oem/logo.gif");
  1520. if (!contents){
  1521. contents = '<h1><img src="/resources/oem/logo.gif"/></h1>';
  1522. } else {
  1523. contents = '<h1><img src="/bitmap/oem/logo.gif"/></h1>';
  1524. }
  1525. }
  1526. if((readSetupByKey("SYS_IS_HATTLELAND_SPEC")) == 1){
  1527. contents3 = '<h3><img src="/resources/oem/logo2.gif"/></h3>';
  1528. document.getElementById('logoarea1').style.display = "";
  1529. $("#logoarea1").html(contents3);
  1530. } else {
  1531. document.getElementById('logoarea1').style.display = "none";
  1532. }
  1533. if(readSetupByKey("SYS_IS_SYSPRO_SPECIFIC") != 1) {
  1534. $("#logoarea").html(contents);
  1535. }
  1536. if(parseInt(readSetupByKey("SYS_IS_HAPCHEON_SPECIFIC")) == 1){
  1537. document.getElementById('logout').style.display = "";
  1538. }
  1539. }
  1540. function T_Term()
  1541. {
  1542. terminateSetup();
  1543. }
  1544. function T_Init()
  1545. {
  1546. initalizeSetup();
  1547. }
  1548. function initLoading()
  1549. {
  1550. // $("#PopupMessage").html("").hide();
  1551. $("#PopupMessage").html("<img src=\"/resources/img/loading.gif\"></img>").hide();
  1552. }
  1553. function showLoading()
  1554. {
  1555. var popup = $("#PopupMessage");
  1556. width = popup.width();
  1557. height = popup.height();
  1558. popup.css("position","absolute")
  1559. .css("z-index","10001")
  1560. .css("top","30%")
  1561. .css("left","50%")
  1562. .css("margin-left", -1 * width / 2)
  1563. .css("margin-top", -1 * height / 2);
  1564. popup.show();
  1565. }
  1566. function hideLoadingDelay(delay)
  1567. {
  1568. setTimeout(function() { $("#PopupMessage").hide(); }, delay);
  1569. }
  1570. /*****************************************************************************/
  1571. function GetVideoAlgorithm(boardid, sysmode, sub, force_detection_cam, cb)
  1572. {
  1573. if (cb == undefined)
  1574. {
  1575. if (sysmode == 1)
  1576. {
  1577. return parseInt(readSetupByKey("VID_CURDECALGORITHM"));
  1578. }
  1579. else
  1580. {
  1581. if (((boardid & 0xffff) == 0xB001) || (force_detection_cam == 1))
  1582. {
  1583. if (sub == 0) return parseInt(readSetupByKey("VID_ALGORITHM"));
  1584. else if (sub == 1) return parseInt(readSetupByKey("VI1_ALGORITHM"));
  1585. else if (sub == 2) return parseInt(readSetupByKey("VI2_ALGORITHM"));
  1586. else if (sub == 3) return parseInt(readSetupByKey("VI3_ALGORITHM"));
  1587. else if (sub == 4) return parseInt(readSetupByKey("VID_DUALALGORITHM"));
  1588. else if (sub == 5) return parseInt(readSetupByKey("VI1_DUALALGORITHM"));
  1589. else if (sub == 6) return parseInt(readSetupByKey("VI2_DUALALGORITHM"));
  1590. else if (sub == 7) return parseInt(readSetupByKey("VI3_DUALALGORITHM"));
  1591. else if (sub == 8) return parseInt(readSetupByKey("VI4_ALGORITHM"));
  1592. else if (sub == 9) return parseInt(readSetupByKey("VI4_DUALALGORITHM"));
  1593. else return parseInt(readSetupByKey("VID_ALGORITHM"));
  1594. }
  1595. else
  1596. {
  1597. if (sub == 0) return parseInt(readSetupByKey("VID_ALGORITHM"));
  1598. else if (sub == 1) return parseInt(readSetupByKey("VID_DUALALGORITHM"));
  1599. else if (sub == 2) return parseInt(readSetupByKey("VID_TRIPLEALGORITHM1"));
  1600. else if (sub == 3) return parseInt(readSetupByKey("VID_TRIPLEALGORITHM2"));
  1601. else return parseInt(readSetupByKey("VID_ALGORITHM"));
  1602. }
  1603. }
  1604. }
  1605. else
  1606. {
  1607. if (sysmode == 1)
  1608. {
  1609. readSetupByKeyAsync("VID_CURDECALGORITHM", cb);
  1610. }
  1611. else
  1612. {
  1613. if (((boardid & 0xffff) == 0xB001) || (force_detection_cam == 1))
  1614. {
  1615. if (sub == 0) readSetupByKeyAsync("VID_ALGORITHM", cb);
  1616. else if (sub == 1) readSetupByKeyAsync("VI1_ALGORITHM", cb);
  1617. else if (sub == 2) readSetupByKeyAsync("VI2_ALGORITHM", cb);
  1618. else if (sub == 3) readSetupByKeyAsync("VI3_ALGORITHM", cb);
  1619. else if (sub == 4) readSetupByKeyAsync("VID_DUALALGORITHM", cb);
  1620. else if (sub == 5) readSetupByKeyAsync("VI1_DUALALGORITHM", cb);
  1621. else if (sub == 6) readSetupByKeyAsync("VI2_DUALALGORITHM", cb);
  1622. else if (sub == 7) readSetupByKeyAsync("VI3_DUALALGORITHM", cb);
  1623. else if (sub == 8) readSetupByKeyAsync("VI4_ALGORITHM", cb);
  1624. else if (sub == 9) readSetupByKeyAsync("VI4_DUALALGORITHM", cb);
  1625. else readSetupByKeyAsync("VID_ALGORITHM", cb);
  1626. }
  1627. else
  1628. {
  1629. if (sub == 0) readSetupByKeyAsync("VID_ALGORITHM", cb);
  1630. else if (sub == 1) readSetupByKeyAsync("VID_DUALALGORITHM", cb);
  1631. else if (sub == 2) readSetupByKeyAsync("VID_TRIPLEALGORITHM1", cb);
  1632. else if (sub == 3) readSetupByKeyAsync("VID_TRIPLEALGORITHM2", cb);
  1633. else readSetupByKeyAsync("VID_ALGORITHM", cb);
  1634. }
  1635. }
  1636. }
  1637. }