Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.07 KB | None | 0 0
  1. <!--
  2. /*
  3. pan: left, right
  4. tilt: up, down
  5. zoom: in, out
  6. focus: near, far
  7. iris: open, close
  8. menu: open, exit
  9. auto_pan: run, stop
  10. set_preset: value(0~9999)
  11. go_preset: value(0~9999)
  12. go_tour: value(0~9999)
  13. pattern: value
  14. */
  15. function cgi(){
  16. this.ajax = new AjaxClass();
  17.  
  18. //login id
  19. this.sid;
  20. //audio id
  21. this.aoid;
  22. //archive id
  23. this.aid;
  24. //playback id
  25. this.pbid="";
  26. //ptz id
  27. this.ptzId;
  28. //ptz speed
  29. this.ptzSpeed;
  30. //search id
  31. this.search_id;
  32. //ptz user level
  33. this.user_level;
  34. //
  35. this.playBackSpeed = new Array(0,1,2,4,8,16,32,64,100,300);
  36. this.FFSpeedFlag = 1;
  37. this.FBSpeedFlag = 1;
  38. this.ptzSpeed=1;
  39. this.autoFlag = 1;
  40. this.menuFlag = 1;
  41. }
  42. cgi.prototype.login = function(login_id, fn){
  43. this.ajax.getAsynData("Live.cgi?cmd=register_stream&video_type=1&login_id="+login_id, fn); //Soya 20120529 Add login_id
  44. }
  45. cgi.prototype.ao_login = function(fn){
  46. this.ajax.getAsynData("Live.cgi?cmd=register_stream&video_type=0", fn);
  47. }
  48. cgi.prototype.setLiveStream = function(no){
  49. this.ajax.getData("Live.cgi?cmd=stream_ctrl&stream_id=" + this.sid + "&camera=" + no);
  50. }
  51. cgi.prototype.setLiveAudio = function(no){
  52. this.ajax.getAsynData("Live.cgi?cmd=stream_ctrl&stream_id=" + this.sid + "&audio=" + no, fnAudio);
  53. }
  54. function fnAudio()
  55. {
  56.  
  57. }
  58. cgi.prototype.checkstream = function(){
  59. return this.ajax.getData("Live.cgi?cmd=stream_check&stream_id=" + this.sid);
  60. }
  61. ////==============================================================
  62. //Login
  63. /*
  64. cgi.prototype.getlogin = function(){
  65. this.ajax.getData("login.cgi");
  66. }
  67. */
  68. //==============================================================
  69. //PTZ
  70. cgi.prototype.tiltUp = function(){
  71. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&speed=" + this.ptzSpeed + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=tilt&value=up");
  72. }
  73. cgi.prototype.tiltDown = function(){
  74. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&speed=" + this.ptzSpeed + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=tilt&value=down");
  75. }
  76. cgi.prototype.panLeft = function(){
  77. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&speed=" + this.ptzSpeed + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=pan&value=left");
  78. }
  79. cgi.prototype.panRight = function(){
  80. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&speed=" + this.ptzSpeed + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=pan&value=right");
  81. }
  82. cgi.prototype.zoomOut = function(){
  83. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=zoom&value=out");
  84. }
  85. cgi.prototype.zoomIn = function(){
  86. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=zoom&value=in");
  87. }
  88. cgi.prototype.focusFar = function(){
  89. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=focus&value=far");
  90. }
  91. cgi.prototype.focusNear = function(){
  92. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=focus&value=near");
  93. }
  94. cgi.prototype.irisOpen = function(){
  95. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=iris&value=open");
  96. }
  97. cgi.prototype.irisClose = function(){
  98. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=iris&value=close");
  99. }
  100. cgi.prototype.ptzstop = function(){
  101. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=stop");
  102. }
  103. cgi.prototype.ptzEnter = function(){
  104. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=enter");
  105. }
  106. cgi.prototype.clear = function(no){
  107. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=clear&value=" + no);
  108. }
  109. cgi.prototype.presetGo = function(no){
  110. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=go_preset&value=" + no);
  111. }
  112. cgi.prototype.presetSet = function(no){
  113. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=set_preset&value=" + no);
  114. }
  115. cgi.prototype.auxOn = function(no){
  116. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=aux_on&value=" + no);
  117. }
  118. cgi.prototype.auxOff = function(no){
  119. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=aux_off&value=" + no);
  120. }
  121. cgi.prototype.autoPan = function(){
  122. var tmpStr = "";
  123. if(this.autoFlag == 0){
  124. tmpStr = "stop";
  125. this.autoFlag = 1;
  126. }else{
  127. tmpStr = "run";
  128. this.autoFlag = 0;
  129. }
  130. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=auto_pan&value=" + tmpStr);
  131. }
  132. cgi.prototype.pattern = function(){
  133. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=pattern&value=1");
  134. }
  135. cgi.prototype.tour = function(){
  136. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=go_tour&value=1");
  137. }
  138. cgi.prototype.menu = function(){
  139. var tmpStr = "";
  140. if(this.menuFlag == 0){
  141. tmpStr = "exit";
  142. this.menuFlag = 1;
  143. }else{
  144. tmpStr = "open";
  145. this.menuFlag = 0;
  146. }
  147. this.ajax.getData("Live.cgi?stream_id=" + this.sid + "&camera=" + this.ptzId + "&cmd=ptz_ctrl&level=" + this.user_level + "&action=menu&value=" + tmpStr);
  148. }
  149. //==============================================================
  150. //PTZ TEST
  151. cgi.prototype.ptzUpTest = function(camera, port, ctrl_id, protocol, baud){
  152. this.ajax.getData("Ptz.cgi?camera=" + camera + "&port=" + port + "&ctrl_id=" + ctrl_id + "&protocol=" + protocol + "&baud=" + baud + "&value=up");
  153. }
  154. cgi.prototype.ptzDownTest = function(camera, port, ctrl_id, protocol, baud){
  155. this.ajax.getData("Ptz.cgi?camera=" + camera + "&port=" + port + "&ctrl_id=" + ctrl_id + "&protocol=" + protocol + "&baud=" + baud + "&value=down");
  156. }
  157. cgi.prototype.ptzLeftTest = function(camera, port, ctrl_id, protocol, baud){
  158. this.ajax.getData("Ptz.cgi?camera=" + camera + "&port=" + port + "&ctrl_id=" + ctrl_id + "&protocol=" + protocol + "&baud=" + baud + "&value=left");
  159. }
  160. cgi.prototype.ptzRightTest = function(camera, port, ctrl_id, protocol, baud){
  161. this.ajax.getData("Ptz.cgi?camera=" + camera + "&port=" + port + "&ctrl_id=" + ctrl_id + "&protocol=" + protocol + "&baud=" + baud + "&value=right");
  162. }
  163. //==============================================================
  164. //Alarm Outputs
  165. cgi.prototype.AlarmOutputs = function(no){
  166. this.ajax.getData("Alarm.cgi?cmd=alarm_outputs&no=" + no); //0~3
  167. }
  168. cgi.prototype.Acknowledge = function(sUsername){ // close alarm beebee
  169. this.ajax.getData("Alarm.cgi?cmd=ack&username="+sUsername);
  170. }
  171. //==============================================================
  172. //playback
  173. cgi.prototype.PbLogin = function(login_id){
  174. this.pbid = this.ajax.getData("Playback.cgi?cmd=register_stream&login_id="+login_id); //Soya 20120529 Add login_id
  175. }
  176. cgi.prototype.setPbStream = function(no){
  177. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&camera=" + no);
  178. }
  179. cgi.prototype.setPbAudio = function(no){
  180. if(this.pbid=="")
  181. return;
  182. this.ajax.getAsynData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&audio=" + no, fnAudio);
  183. }
  184. cgi.prototype.PBcancel = function(){
  185. if(this.pbid=="")
  186. return;
  187. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=cancel");
  188. this.FFSpeedFlag = 1;
  189. this.FBSpeedFlag = 1;
  190. this.pbid="";
  191. }
  192. cgi.prototype.PBpause = function(){
  193. if(this.pbid=="")
  194. return;
  195. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=pause");
  196. this.FFSpeedFlag = 1;
  197. this.FBSpeedFlag = 1;
  198. }
  199. cgi.prototype.PBbackward = function(){
  200. if(this.pbid=="")
  201. return;
  202. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=backward");
  203. this.FFSpeedFlag = 1;
  204. this.FBSpeedFlag = 1;
  205. }
  206. cgi.prototype.PBforward = function(){
  207. if(this.pbid=="")
  208. return;
  209. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=forward");
  210. this.FFSpeedFlag = 1;
  211. this.FBSpeedFlag = 1;
  212. }
  213. cgi.prototype.PBcheckDST = function(sTime){
  214. return this.ajax.getData("Playback.cgi?cmd=check_dst&time="+sTime);
  215. }
  216. cgi.prototype.PBcheckHDD = function(){
  217. return this.ajax.getData("Playback.cgi?cmd=check_hdd");
  218. }
  219. /*cgi.prototype.PBfastBackward = function(){
  220. //args[0] speed
  221. var args = arguments;
  222. if(args[0] != null){
  223. this.FBSpeedFlag = args[0];
  224. }else{
  225. if(this.FBSpeedFlag < 9){
  226. this.FBSpeedFlag++;
  227. }
  228. }
  229. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=fast-backward&speed=" + this.playBackSpeed[this.FBSpeedFlag]);
  230. this.FFSpeedFlag = 1;
  231. }
  232. cgi.prototype.PBfastForward = function(){
  233. //args[0] speed
  234. var args = arguments;
  235. if(args[0] != null){
  236. this.FFSpeedFlag = args[0];
  237. }else{
  238. if(this.FFSpeedFlag < 9){
  239. this.FFSpeedFlag++;
  240. }
  241. }
  242. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=fast-forward&speed=" + this.playBackSpeed[this.FFSpeedFlag]);
  243. this.FBSpeedFlag = 1;
  244. }*/
  245. cgi.prototype.PBSeekTo = function(TimeStamp){
  246.  
  247. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=webseek&seek_time=" + TimeStamp);
  248. }
  249. cgi.prototype.PBfastBackward = function(speed){
  250. //args[0] speed
  251. /*var args = arguments;
  252. if(args[0] != null){
  253. this.FBSpeedFlag = args[0];
  254. }else{
  255. if(this.FBSpeedFlag < 9){
  256. this.FBSpeedFlag++;
  257. }
  258. }*/
  259. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=fast-backward&speed=" + this.playBackSpeed[speed]);
  260. this.FFSpeedFlag = 1;
  261. }
  262. cgi.prototype.PBfastForward = function(speed){
  263. //args[0] speed
  264. /*var args = arguments;
  265. if(args[0] != null){
  266. this.FFSpeedFlag = args[0];
  267. }else{
  268. if(this.FFSpeedFlag < 9){
  269. this.FFSpeedFlag++;
  270. }
  271. }*/
  272. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=fast-forward&speed=" + this.playBackSpeed[speed]);
  273. this.FBSpeedFlag = 1;
  274. }
  275. cgi.prototype.PBstepBackward = function(){
  276. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=step-backward");
  277. this.FFSpeedFlag = 1;
  278. this.FBSpeedFlag = 1;
  279. }
  280. cgi.prototype.PBstepForward = function(){
  281. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&action=step-forward");
  282. this.FFSpeedFlag = 1;
  283. this.FBSpeedFlag = 1;
  284. }
  285. cgi.prototype.setPbMask = function(){
  286. var args=arguments;
  287. var val;
  288. var val2;
  289. var mask=0;
  290. if(args.length==1)
  291. mask=args[0];
  292. else{
  293. val=args[0];
  294. val2=args[1];
  295. var max=val*val;
  296. for(var i=0;i<val*val;i++){
  297. mask+= 1<<(val2+i);
  298. }
  299. }
  300. this.ajax.getData("Playback.cgi?cmd=stream_ctrl&stream_id=" + this.pbid + "&change_map_only=" + mask);
  301. }
  302. //==============================================================
  303. //archive
  304. cgi.prototype.getAid = function(login_id){
  305. this.aid = this.ajax.getData("Archive.cgi?cmd=register_stream&login_id="+login_id); //Soya 20120529 Add login_id
  306. }
  307. //Soya 20100604 Add DST
  308. cgi.prototype.requestArchive = function(cam, start_time, end_time, dst, level, username){
  309. return this.ajax.getData("Archive.cgi?cmd=query&camera=" + cam + "&start_time=" + start_time + "&end_time=" + end_time + "&dst="+ dst + "&level=" + level + "&username=" + username);
  310. }
  311. cgi.prototype.cancelArchive = function(username){
  312. return this.ajax.getData("Archive.cgi?cmd=archive_ctrl&action=cancel&stream_id=" + this.aid + "&username=" + username);
  313. }
  314. cgi.prototype.ArchivecheckDST = function(sTime,eTime,sCamMap, username){
  315. return this.ajax.getData("Archive.cgi?cmd=check_dst&start_time="+sTime+"&end_time="+eTime+"&camera="+sCamMap + "&username=" + username);
  316. }
  317. //==============================================================
  318. //disk
  319. cgi.prototype.diskFormat = function(){
  320. return this.ajax.getData("Disk.cgi?cmd=format");
  321. }
  322. cgi.prototype.diskDelete = function(){
  323. return this.ajax.getData("Disk.cgi?cmd=delete");
  324. }
  325. cgi.prototype.diskUnlock = function(){
  326. return this.ajax.getData("Disk.cgi?cmd=unlock");
  327. }
  328. //==============================================================
  329. //log
  330. cgi.prototype.getLogTotal = function(type){
  331. //Configurations 1
  332. //Event 2
  333. //Record 4
  334. //Operation 8
  335. //User 16
  336. return this.ajax.getData("Log.cgi?cmd=count&type=" + type);
  337. }
  338. /*cgi.prototype.getLogStatus = function(){
  339. return this.ajax.getData("Log.cgi?cmd=log_status");
  340. }*/
  341. cgi.prototype.getLogItem = function(idx,no,type){
  342. //Configurations 1
  343. //Event 2
  344. //Record 4
  345. //Operation 8
  346. //User 16
  347. return this.ajax.getData("Log.cgi?cmd=log_search&index=" + idx + "&total=" + no + "&type=" + type);
  348. }
  349. cgi.prototype.clearLog = function(){
  350. return this.ajax.getData("Log.cgi?cmd=clear_log");
  351. }
  352. cgi.prototype.logDelete = function(cam,st,et,bid){
  353. return this.ajax.getData("Delete.cgi?camera=" + cam + "&start_time=" + st + "&end_time=" + et + "&block_id=" + bid);
  354. }
  355. cgi.prototype.logUnlock = function(cam,st,et,bid){
  356. return this.ajax.getData("Unlock.cgi?camera=" + cam + "&start_time=" + st + "&end_time=" + et + "&block_id=" + bid);
  357. }
  358. cgi.prototype.logLock = function(cam,st,et,bid){
  359. return this.ajax.getData("Lock.cgi?camera=" + cam + "&start_time=" + st + "&end_time=" + et + "&block_id=" + bid);
  360. }
  361. //4Mosa
  362. //==============================================================
  363. //Search Log
  364. cgi.prototype.getLogData = function(type){
  365. // system: 0x01
  366. // record: 0x02
  367. // login: 0x04
  368. // configure: 0x08
  369. // operation: 0x10
  370. // all: 0x1f
  371. // service: 0x3f
  372. return this.ajax.getData("Log.cgi?cmd=count&type=" + type);
  373. }
  374. cgi.prototype.getLogStatus = function(){
  375. return this.ajax.getData("Log.cgi?cmd=log_status");
  376. }
  377. cgi.prototype.getLogPageData = function(type, page){
  378. // system: 0x01
  379. // record: 0x02
  380. // login: 0x04
  381. // configure: 0x08
  382. // operation: 0x10
  383. // all: 0x1f
  384. // service: 0x3f
  385. return this.ajax.getData("Log.cgi?cmd=count&type=" + type + "&page=" + page);
  386. }
  387. //==============================================================
  388. //Export Log
  389. cgi.prototype.ExportLogStart = function(){ //**No Used
  390. return this.ajax.getData("Log.cgi?cmd=export_log_start");
  391. }
  392. cgi.prototype.ExportLogStatus = function(){ //**No Used
  393. return this.ajax.getData("Log.cgi?cmd=export_log_status");
  394. }
  395. //==============================================================
  396. //firmware
  397. cgi.prototype.getFwUploadStatus = function(){
  398. return this.ajax.getData("FW_Upgrade.cgi?cmd=upload_fw_status");
  399. }
  400. cgi.prototype.getFwUpgradeVar = function(){
  401. return this.ajax.getData("FW_Upgrade.cgi?cmd=fw_upgrade_read_ver");
  402. }
  403. cgi.prototype.getFwUpgradeStart = function(){
  404. return this.ajax.getData("FW_Upgrade.cgi?cmd=fw_upgrade_start");
  405. }
  406. cgi.prototype.getFwUpgradeStatus = function(){
  407. return this.ajax.getData("FW_Upgrade.cgi?cmd=fw_upgrade_status");
  408. }
  409. //==============================================================
  410. //config
  411. /*cgi.prototype.clearDefaultStatus = function(){
  412. return this.ajax.getData("Config.cgi?cmd=clear_default_status");
  413. }*/
  414. cgi.prototype.loadDefault = function(){
  415. return this.ajax.getData("Config.cgi?cmd=load_default");
  416. }
  417. cgi.prototype.getLoadDefaultStatus = function(){
  418. return this.ajax.getData("Config.cgi?cmd=load_default_status");
  419. }
  420. /*cgi.prototype.loadDefaultFinish = function(){
  421. return this.ajax.getData("Config.cgi?cmd=load_default_finish");
  422. }*/
  423. cgi.prototype.getLoadConfigStatus = function(){
  424. return this.ajax.getData("Config.cgi?cmd=load_config_status");
  425. }
  426. cgi.prototype.setSystemDateTime = function(datetime){
  427. return this.ajax.getData("Config.cgi?cmd=set_date_time&datetime=" + datetime);
  428. }
  429. cgi.prototype.rebootDVR = function(){
  430. return this.ajax.getData("Config.cgi?cmd=reboot");
  431. }
  432. //==============================================================
  433. //user
  434. cgi.prototype.getUser = function(){
  435. return this.ajax.getData("User.cgi?cmd=get_user");
  436. }
  437. cgi.prototype.getlogin = function(sUsername,sPassword){
  438. return this.ajax.getData("User.cgi?cmd=get_login&username="+sUsername+"&password="+sPassword);
  439. }
  440. //Soya 20110217 add "cmd=save_user"
  441. cgi.prototype.setUser = function(name,password,level){
  442. return this.ajax.getData("User.cgi?cmd=save_user&name="+name+"&password="+password+"&level="+level);
  443. }
  444. //Soya 20110217 add Not Used
  445. /*cgi.prototype.Userlogoff = function(login_id){
  446. return this.ajax.getData("User.cgi?cmd=user_logout&login_id="+login_id);
  447. }*/
  448. cgi.prototype.Userlogoff = function(login_id){
  449. return this.ajax.getData("quick_logout.cgi?cmd=user_logout&login_id="+login_id);
  450. }
  451. //==============================================================
  452. //search
  453. //Soya 20100604 Add username
  454. //Soya 20120529 Add login_id
  455. cgi.prototype.getSearchId = function(start_time,end_time,cam,conditions,sensitivity,level,username,login_id,grid){
  456. var tmpUrl = "Search.cgi?cmd=search&start_time=" + start_time + "&end_time=" + end_time + "&camera=" + cam + "&conditions=" + conditions + "&sensitivity=" + sensitivity + "&level=" + level + "&username=" + username + "&login_id=" + login_id;
  457. if(grid != null){
  458. tmpUrl += "&grid=" + grid;
  459. }
  460. return this.ajax.getData(tmpUrl);
  461. }
  462. cgi.prototype.getSearchData = function(){
  463. return this.ajax.getData("Search.cgi?cmd=search&search_id=" + this.search_id);
  464. }
  465. cgi.prototype.cancelSearch = function(){
  466. return this.ajax.getData("Search.cgi?cmd=search&search_id=" + this.search_id + "&action=cancel");
  467. }
  468. //==============================================================
  469. //Diskmap
  470. //Soya 20100604 Add username
  471. cgi.prototype.getDiskmap = function(start_time, type, offset, level, username){
  472. return this.ajax.getData("Search.cgi?cmd=diskmap&start_time=" + start_time + "&type=" + type + "&offset=" + offset +"&level=" + level + "&username=" + username);
  473. }
  474. cgi.prototype.getDiskmapStatus = function(){
  475. return this.ajax.getData("Search.cgi?cmd=diskmap_status");
  476. }
  477. //���o���w��
  478. cgi.prototype.getSubDiskmapStatus = function(ch1,ch2){
  479. return this.ajax.getData("Search.cgi?cmd=diskmap_status&start_channel="+ch1+"&end_channel="+ch2);
  480. }
  481. //==============================================================
  482. //For SDK TimeLine
  483. cgi.prototype.getTimeLine = function(ch, start_time, end_time, Granularity, username, login_id){
  484. return this.ajax.getData("Search.cgi?cmd=timeline&start_time="+start_time+"&end_time="+end_time+"&sdk_cmd=0&channel="+ch+"&granularity="+Granularity+"&username="+username+"&login_id="+login_id);
  485. }
  486. cgi.prototype.getTimeLineStatus = function(ch, login_id){
  487. return this.ajax.getData("Search.cgi?cmd=timeline_status&sdk_cmd=0&login_id=" + login_id + "&channel="+ch);
  488. }
  489. /*cgi.prototype.clearEventSearchStatus = function(){
  490. return this.ajax.getData("Search.cgi?cmd=clear_event_status");
  491. }
  492. cgi.prototype.getEventSearch = function(start_time,end_time,cam_mask,type){
  493. this.ajax.getData("Search.cgi?event_start_time=" + start_time + "&event_end_time=" + end_time + "&event_camera=" + cam_mask + "&event_type=" + type);
  494. }
  495. cgi.prototype.getEventSearchStatus = function(){
  496. return this.ajax.getData("Search.cgi?cmd=get_event_status");
  497. }*/
  498. //Get Datetime //login_id YYYYMMDDhhmmssms
  499. cgi.prototype.getDateTimeInfo = function(login_id,user_level,login_name,check_datetime){
  500. //var objfun = function(objxml){alert(objxml)}
  501. var rt=this.ajax.getAsynData("cal_info.cgi?login_id="+login_id+"&user_level="+user_level+"&login_name="+login_name+"&check_datetime="+check_datetime+"&sdk=0",returnSystemInfo);
  502. //var objfun = function(objxml){alert(objxml.xml)}
  503. //get_xml_value(objfun,"GET","",true,"http://192.168.98.234/cal.cgi?login_id="+login_id+"&user_level="+user_level+"&login_name="+login_name+"&check_datetime="+check_datetime);
  504. }
  505.  
  506. //Information
  507. cgi.prototype.getSystemInfo = function(){
  508. return this.ajax.getData("Config.cgi?cmd=system_info");
  509. }
  510.  
  511. //Information mass update test
  512. cgi.prototype.getSystemInfoEx = function(url){
  513. return this.ajax.getData("http://"+url+"/Config.cgi?cmd=system_info");
  514. }
  515.  
  516. cgi.prototype.getRecordTime = function(){
  517. return this.ajax.getData("Config.cgi?cmd=record_time");
  518. }
  519. //NTP Test
  520. cgi.prototype.NtpStart = function(timeserver, privateserver){
  521. return this.ajax.getData("ntp.cgi?cmd=ntp_start&time_server="+timeserver+"&private_server="+privateserver);
  522. }
  523. cgi.prototype.NtpStatus = function(){
  524. return this.ajax.getData("ntp.cgi?cmd=ntp_status");
  525. }
  526. //Soya test
  527. cgi.prototype.Header_Test = function(){
  528. this.ajax.HeaderTest();
  529. }
  530. // factory
  531. cgi.prototype.FactoryStatus = function(){
  532. return this.ajax.getData("Special.cgi?");
  533. }
  534. // factory
  535. cgi.prototype.Debug_cmd = function(cmd, value){
  536. return this.ajax.getData("Debug.cgi?cmd="+cmd+"&value="+value);
  537. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement