Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

888 lines
22 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. ob_start();
  4. $UID = intval( $CUser->Data['id'] );
  5. $ACCESS = intval( $CUser->Data['access'] );
  6. if( $UID > 1 ){
  7. $CID = intval( $_POST['CID'] );
  8. $QS = "SELECT * FROM `cameras` WHERE `id`={$CID}";
  9. $Result = $DATABASE->Query( $QS, false );
  10. $STREAMS = array();
  11. if( count( $Result ) ){
  12. $Cam = $Result[0];
  13. $Cam['name']=urldecode( $Cam['name'] );
  14. $TB = explode( ' ', $Cam['name'] );
  15. $Cam['name'] = $TB[0];
  16. if( stripos($Cam['ip'],'/dev/video') !==false ){
  17. $CLS = "camera_analog_set";
  18. $CAM_IP = false;
  19. } else {
  20. $CAM_IP = true;
  21. $CamLabel = $Cam['name'] . '_' . $CID;
  22. if( stripos( $Cam['name'], 'hikvision' ) !== false ){
  23. $CLS = "camera_hikvision_set";
  24. } elseif( stripos( $Cam['name'], 'dahua' ) !== false ){
  25. $CLS = "camera_dahua_set";
  26. } elseif( stripos( $Cam['name'], 'axis' ) !== false ){
  27. $CLS = "camera_axis_set";
  28. } elseif( stripos( $Cam['name'], 'GF0' ) !== false ){
  29. $CLS = "cam_vehicle_set";
  30. } else {
  31. $CLS = "camera_generic_set";
  32. };
  33. };
  34. $QS = "SELECT * FROM media_streams WHERE source_id={$CID}";
  35. $Result = $DATABASE->Query($QS,false);
  36. $SELECTED_STREAM = 0;
  37. $STREAMS = array();
  38. if( count( $Result ) > 0 ){
  39. $ii = 0;
  40. foreach( $Result as $CD ){
  41. $STREAMS[] = "[{$CD['id']},'{$CD['name']}','{$CD['img_width']}x{$CD['img_height']}@{$CD['fps']}','{$CD['compression_type']}',{$CD['bitrate']}]";
  42. if( $Cam['stream_id'] == $CD['id'] ) $SELECTED_STREAM = $ii;
  43. $ii++;
  44. };
  45. };
  46. $STREAMS = implode(',',$STREAMS);
  47. $QS="SELECT re.aux_id, re.device FROM resources re LEFT JOIN nodes no ON( re.node_id = no.id ) WHERE ( re.type=1 OR re.type=129 ) ";
  48. $RR=$DATABASE->Query( $QS );
  49. if( count( $RR ) ){
  50. $RE=array();
  51. foreach( $RR as $R ){
  52. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  53. };
  54. $UARTS = implode( ',', $RE );
  55. } else {
  56. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  57. };
  58. $ATAB = 0;
  59. //v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1 --stream-to=output.jpg
  60. if( $CAM_IP ){
  61. $RESET_CREDENTIALS=<<<kskjhiiuwye
  62. ,{
  63. xtype: 'button',
  64. width: '100%',
  65. text: '{$Labels->GetLabel('_RSET_CREDENTIALS_')}',
  66. handler: function(){
  67. }
  68. }
  69. kskjhiiuwye;
  70. } else {
  71. $RESET_CREDENTIALS='';
  72. };
  73. if( $Cam['status'] < 3 ){
  74. $ADD_CAMERA=<<<hzzhoiuyhetrkh
  75. {
  76. xtype: 'button',
  77. width: '100%',
  78. text: '{$Labels->GetLabel('_ASSIGN_CAMERA_')}',
  79. handler: function(){
  80. Ext.Ajax.request({
  81. url: '/lib/controller/doCameraOperation.php',
  82. params: {
  83. UID: {$UserID},
  84. SID: '{$Session}',
  85. CMD: 2,
  86. CID: {$CID}
  87. },
  88. success: function( response, opts ){
  89. var tData = Ext.decode(response.responseText);
  90. if( tData.status == 'ok' ){
  91. loadDetectedCameras();
  92. } else {
  93. Ext.Msg.show({
  94. title:'Error!',
  95. msg: tData.msg,
  96. buttons: Ext.Msg.OK,
  97. icon: Ext.MessageBox.ERROR
  98. });
  99. };
  100. },
  101. failure: failureAJAXFunction
  102. });
  103. }
  104. }
  105. hzzhoiuyhetrkh;
  106. } else {
  107. $RESET_CREDENTIALS='';
  108. $ADD_CAMERA=<<<hhoiuyhetrkh
  109. {
  110. xtype: 'button',
  111. width: '100%',
  112. text: '{$Labels->GetLabel('_REMOVE_CAMERA_')}',
  113. handler: function(){
  114. Ext.Ajax.request({
  115. url: '/lib/controller/doCameraOperation.php',
  116. params: {
  117. UID: {$UserID},
  118. SID: '{$Session}',
  119. CMD: 7,
  120. CID: {$CID}
  121. },
  122. success: function( response, opts ){
  123. var tData = Ext.decode(response.responseText);
  124. if( tData.status == 'ok' ){
  125. loadAssignedCameras();
  126. } else {
  127. Ext.Msg.show({
  128. title:'Error!',
  129. msg: tData.msg,
  130. buttons: Ext.Msg.OK,
  131. icon: Ext.MessageBox.ERROR
  132. });
  133. };
  134. },
  135. failure: failureAJAXFunction
  136. });
  137. }
  138. }
  139. hhoiuyhetrkh;
  140. };
  141. $BBAR_BTN = $ADD_CAMERA;
  142. $TPL_SET_CREDS_IP=<<<ZUZAKA
  143. {
  144. xtype: 'form',
  145. id: 'cam_credentials',
  146. labelWidth: 260,
  147. labelAlign: 'right',
  148. items: [{
  149. xtype: 'panel',
  150. height: 290,
  151. border: false,
  152. frame: false,
  153. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  154. },{
  155. xtype: 'panel',
  156. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  157. },{
  158. xtype: 'panel',
  159. html: '<div class="sideInfo_item" id="INFO_ID">{$Labels->GetLabel('_PROV_CAC_')}</div>'
  160. },{
  161. xtype: 'textfield',
  162. id: 'cam_login',
  163. fieldLabel: '{$Labels->GetLabel('__LOGIN__')}',
  164. width: 200
  165. },{
  166. xtype: 'textfield',
  167. id: 'cam_password',
  168. inputType: 'password',
  169. fieldLabel: '{$Labels->GetLabel('__PASSWORD__')}',
  170. width: 200
  171. },{
  172. xtype: 'combo',
  173. id: 'cam_auth_mode',
  174. fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
  175. lazyRender: true,
  176. mode: 'local',
  177. forceSelection: true,
  178. triggerAction: 'all',
  179. editable: false,
  180. disableKeyFilter: true,
  181. store: new Ext.data.ArrayStore({
  182. fields: ['mode','mode_txt'],
  183. data: [
  184. [0,'BASIC'],
  185. [1,'DIGEST'],
  186. [2,'DIGEST_IE'],
  187. [3,'BEARER'],
  188. [4,'NEGOTIATE'],
  189. [5,'NTLM'],
  190. [6,'NTLM_WB'],
  191. [7,'ANY'],
  192. [8,'ANYSAFE'],
  193. [9,'ONLY'],
  194. [10,'AWS_SIGV4']
  195. ]
  196. }),
  197. valueField: 'mode',
  198. displayField: 'mode_txt',
  199. value: 0,
  200. width: 200
  201. },{
  202. xtype: 'button',
  203. width: '100%',
  204. text: '{$Labels->GetLabel('_SET_CREDENTIALS_')}',
  205. handler: function(){
  206. addDetCamWM = new Ext.LoadMask( Ext.getCmp('cam_credentials').getEl(), {msg:"{$Labels->GetLabel('_Please_Wait_')}..."});
  207. addDetCamWM.show();
  208. var NUU = Ext.getCmp('cam_login').getValue();
  209. var NPP = Ext.getCmp('cam_password').getValue();
  210. var NAM = Ext.getCmp('cam_auth_mode').getValue();
  211. Ext.Ajax.request({
  212. url: '/lib/controller/doCameraOperation.php',
  213. params: {
  214. UID: {$UserID},
  215. SID: '{$Session}',
  216. CID: {$CID},
  217. UU: NUU,
  218. PP: NPP,
  219. AU: NAM,
  220. CMD: 3
  221. },
  222. success: function( response, opts ){
  223. addDetCamWM.hide();
  224. var data = Ext.decode(response.responseText);
  225. if( data.status == 'ok' ){
  226. loadDetectedCameras();
  227. } else {
  228. Ext.Msg.show({
  229. title:'Error!',
  230. msg: data.msg,
  231. buttons: Ext.Msg.OK,
  232. icon: Ext.MessageBox.WARNING
  233. });
  234. };
  235. },
  236. failure: failureAJAXFunction
  237. });
  238. }
  239. }]
  240. }
  241. ZUZAKA;
  242. $TPL_ANALOG_CAM =<<<CHUPAKABRA
  243. {
  244. xtype: 'panel',
  245. id: 'cam_info',
  246. labelWidth: 260,
  247. labelAlign: 'right',
  248. bbar:[{$BBAR_BTN}],
  249. items: [{
  250. xtype: 'panel',
  251. height: 290,
  252. border: false,
  253. frame: false,
  254. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  255. },{
  256. xtype: 'panel',
  257. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  258. }]
  259. }
  260. CHUPAKABRA;
  261. $QS="SELECT * FROM `module_eve` WHERE `id`=1";
  262. $S=$DATABASE->Query( $QS );
  263. $MODULE_DATA = $S[0];
  264. if( $Cam['status'] < 3 ){
  265. $FU = "/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID=";
  266. } else {
  267. $FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id=';
  268. };
  269. $TPL_CAM_EDITOR=<<<PZAKSJEJSDKGJHGASD
  270. {
  271. id: 'camedi_tabs',
  272. xtype: 'tabpanel',
  273. activeTab: 0,
  274. bbar:[{$BBAR_BTN}],
  275. items: [{
  276. title: '{$Labels->GetLabel('_CAC_TAB_')}',
  277. id: 'cam_info',
  278. frame: false,
  279. border: false,
  280. items: [{
  281. xtype: 'panel',
  282. height: 290,
  283. border: false,
  284. frame: false,
  285. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  286. },{
  287. xtype: 'panel',
  288. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  289. }{$RESET_CREDENTIALS}]
  290. },{
  291. title: '{$Labels->GetLabel('_STREAMS_')}',
  292. id: 'str_tab',
  293. frame: false,
  294. border: false,
  295. items:[{
  296. xtype: 'grid',
  297. height: 124,
  298. id: 'nd_cam_grid',
  299. frame: false,
  300. ds: new Ext.data.ArrayStore({
  301. fields: ['id','name','size','encode','bitrate'],
  302. data: [{$STREAMS}]
  303. }),
  304. cm: new Ext.grid.ColumnModel({
  305. columns: [
  306. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  307. {header: "Name", dataIndex: 'name' },
  308. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  309. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  310. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  311. ],
  312. defaults: {
  313. sortable: false,
  314. menuDisabled: true,
  315. width: 100
  316. }
  317. }),
  318. sm: new Ext.grid.RowSelectionModel({
  319. singleSelect: true,
  320. listeners: {
  321. rowselect: function(sm, row, rec) {
  322. SelectedSource = rec.data.id;
  323. doCamOperation( {$CID}, 1, SelectedSource );
  324. var tt = Ext.getCmp('pic_prev');
  325. if( tt!= undefined ){
  326. //tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  327. tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
  328. };
  329. }
  330. }
  331. }),
  332. listeners:{
  333. viewready: function( t ){
  334. var tt = t.getSelectionModel();
  335. tt.selectRow({$SELECTED_STREAM});
  336. }
  337. }
  338. },{
  339. height: PanelH,
  340. id: 'pic_prev',
  341. html: '<center><img width="100%" src="/style/img/cam_cap0.png"></center>',
  342. listeners:{
  343. afterrender: function( t ){
  344. if( SelectedSource ){
  345. //t.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  346. };
  347. }
  348. }
  349. }],
  350. },{
  351. title: 'Lens Settings',
  352. id: 'lens_tab',
  353. frame: false,
  354. border: false,
  355. items:[{
  356. layout: 'table',
  357. frame: false,
  358. border: false,
  359. layoutConfig: {
  360. columns: 3
  361. },
  362. defaults: {
  363. frame: false,
  364. bodyStyle: 'padding:10px',
  365. border: false
  366. },
  367. items:[{
  368. width: 200,
  369. html: 'Sensor Size'
  370. },{
  371. xtype: 'combo',
  372. fieldLabel: 'Sensor Size',
  373. lazyRender: true,
  374. id: 'sens_size',
  375. mode: 'local',
  376. forceSelection: true,
  377. triggerAction: 'all',
  378. editable: false,
  379. disableKeyFilter: true,
  380. store: new Ext.data.ArrayStore({
  381. fields: ['size','size_txt'],
  382. data: [
  383. [0,'1/3.6"'],
  384. [1,'1/3.2"'],
  385. [2,'1/3"'],
  386. [3,'1/2.7"'],
  387. [4,'1/2"'],
  388. [5,'1/1.8"'],
  389. [6,'2/3"'],
  390. [7,'1"'],
  391. [8,'4/3"'],
  392. [9,'APS-C'],
  393. [10,'35 mm'],
  394. [11,'645']
  395. ]
  396. }),
  397. valueField: 'size',
  398. displayField: 'size_txt',
  399. value: {$Cam['imager_type']},
  400. listeners:{
  401. select:function( c, r, i ){
  402. doCamOperation( {$CID}, 2, i );
  403. }
  404. }
  405. },{
  406. html: '&nbsp;'
  407. },{
  408. html: 'Focal Length'
  409. },{
  410. xtype: 'combo',
  411. fieldLabel: 'Lens Focal Length',
  412. lazyRender: true,
  413. id: 'lens_fl',
  414. mode: 'local',
  415. forceSelection: true,
  416. triggerAction: 'all',
  417. editable: false,
  418. disableKeyFilter: true,
  419. store: new Ext.data.ArrayStore({
  420. fields: ['fl','fl_txt'],
  421. data: [
  422. [0,'2.7 mm.'],
  423. [1,'3.0 mm.'],
  424. [2,'3.2 mm.'],
  425. [3,'3.5 mm.'],
  426. [4,'3.7 mm.'],
  427. [5,'3.9 mm.'],
  428. [6,'4.0 mm.'],
  429. [7,'4.3 mm.'],
  430. [8,'4.8 mm.'],
  431. [9,'5.0 mm.'],
  432. [10,'5.1 mm.'],
  433. [11,'5.5 mm.'],
  434. [12,'5.8 mm.'],
  435. [13,'6.0 mm.'],
  436. [14,'6.2 mm.'],
  437. [15,'6.6 mm.'],
  438. [16,'7.0 mm.'],
  439. [17,'7.1 mm.'],
  440. [18,'7.5 mm.'],
  441. [19,'7.6 mm.'],
  442. [20,'8.0 mm.'],
  443. [21,'8.6 mm.'],
  444. [22,'8.9 mm.'],
  445. [23,'9.0 mm.'],
  446. [24,'9.2 mm.'],
  447. [25,'9.3 mm.'],
  448. [26,'10.0 mm.'],
  449. [27,'10.5 mm.'],
  450. [28,'10.6 mm.'],
  451. [29,'10.7 mm.'],
  452. [30,'11.0 mm.'],
  453. [31,'11.3 mm.'],
  454. [32,'12.0 mm.'],
  455. [33,'12.9 mm.'],
  456. [34,'13.0 mm.'],
  457. [35,'13.5 mm.'],
  458. [36,'13.6 mm.'],
  459. [37,'14.0 mm.'],
  460. [38,'14.6 mm.'],
  461. [39,'15.0 mm.'],
  462. [40,'15.1 mm.'],
  463. [41,'15.5 mm.'],
  464. [42,'16.0 mm.'],
  465. [43,'17.0 mm.'],
  466. [44,'17.5 mm.'],
  467. [44,'17.7 mm.'],
  468. [45,'18.0 mm.'],
  469. [46,'18.2 mm.'],
  470. [47,'19.0 mm.']
  471. ]
  472. }),
  473. valueField: 'fl',
  474. displayField: 'fl_txt',
  475. value: {$Cam['lens_f']},
  476. listeners:{
  477. select:function( c, r, i ){
  478. doCamOperation( {$CID}, 3, i );
  479. }
  480. }
  481. },{
  482. html: '&nbsp;'
  483. },{
  484. html: 'Fixed Zoom'
  485. },{
  486. xtype: 'radio',
  487. id: 'no_zoom',
  488. name: 'zoom_ena',
  489. value: ( parseFloat({$Cam['zoom']})==0 ),
  490. checked: ( parseFloat({$Cam['zoom']})==0 ),
  491. listeners:{
  492. change: function( r, n, o ){
  493. if( n ) {
  494. doCamOperation( {$CID}, 4, 0.0 );
  495. };
  496. }
  497. }
  498. },{
  499. html: '&nbsp;'
  500. },{
  501. html: 'Variable Zoom'
  502. },{
  503. xtype: 'radio',
  504. id: 'on_zoom',
  505. hideLabel: false,
  506. fieldLabel: 'Variable Zoom',
  507. name: 'zoom_ena',
  508. value: ({$Cam['zoom']}>0.0),
  509. checked: ({$Cam['zoom']}>0.0),
  510. handler: function( a, c ){
  511. if( c ){
  512. Ext.getCmp('zoom_val').enable();
  513. Ext.getCmp('zoom_val').setValue( 1 );
  514. var zz = Ext.getCmp('zoom_d');
  515. if( zz.rendered ) zz.update('<p>X&nbsp;1</p>');
  516. } else {
  517. Ext.getCmp('zoom_val').disable();
  518. var zz = Ext.getCmp('zoom_d');
  519. if( zz.rendered ) zz.update('&nbsp;');
  520. };
  521. },
  522. listeners:{
  523. change: function( r, n, o ){
  524. if( n ) {
  525. doCamOperation( {$CID}, 4, 1.0 );
  526. };
  527. }
  528. }
  529. },{
  530. html: '&nbsp;'
  531. },{
  532. html: 'Zoom Ratio'
  533. },{
  534. xtype: 'slider',
  535. id: 'zoom_val',
  536. disabled: ( parseFloat({$Cam['zoom']})==0 ),
  537. minValue: 1.0,
  538. maxValue: 40.0,
  539. value: {$Cam['zoom']},
  540. listeners:{
  541. change: function( a, c, b ){
  542. doCamOperation( {$CID}, 4, c );
  543. var zz = Ext.getCmp('zoom_d');
  544. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  545. }
  546. }
  547. },{
  548. id: 'zoom_d',
  549. html: (( parseFloat({$Cam['zoom']})==0 )?'&nbsp;':'<p>X&nbsp;'+ {$Cam['zoom']} + '</p>' )
  550. }]
  551. }]
  552. },{
  553. title: '{$Labels->GetLabel('_PTZ_TAB_')}',
  554. id: 'ptz_tab',
  555. frame: false,
  556. border: false,
  557. items:[{
  558. layout: 'table',
  559. frame: false,
  560. border: false,
  561. layoutConfig: {
  562. columns: 3
  563. },
  564. defaults: {
  565. frame: false,
  566. bodyStyle: 'padding:10px',
  567. border: false
  568. },
  569. items:[{
  570. width: 200,
  571. html: '{$Labels->GetLabel('__PTZ_CONTROL__')}'
  572. },{
  573. xtype: 'combo',
  574. fieldLabel: '{$Labels->GetLabel('__PTZ_CONTROL__')}',
  575. lazyRender: true,
  576. id: 'ptz_proto',
  577. mode: 'local',
  578. forceSelection: true,
  579. triggerAction: 'all',
  580. editable: false,
  581. disableKeyFilter: true,
  582. store: new Ext.data.ArrayStore({
  583. fields: ['type','type_txt'],
  584. data: [
  585. [0,'{$Labels->GetLabel('_NO_PTZ_')}'],
  586. [1,'Sony VISCA'],
  587. [2,'Pelco-D'],
  588. [3,'OnVif'],
  589. [4,'PSIA'],
  590. [5,'GB/T28181']
  591. ]
  592. }),
  593. value: {$Cam['protocol']},
  594. valueField: 'type',
  595. displayField: 'type_txt',
  596. listeners:{
  597. select: function( a, c, b ){
  598. doCamOperation( {$CID}, 5, b );
  599. if( b > 0 ){
  600. if( b != 3 ){
  601. Ext.getCmp('uart_id').enable();
  602. Ext.getCmp('prot_id').enable();
  603. } else {
  604. Ext.getCmp('uart_id').disable();
  605. Ext.getCmp('prot_id').disable();
  606. };
  607. Ext.getCmp('pan_mode').enable();
  608. Ext.getCmp('tilt_mode').enable();
  609. Ext.getCmp('pan_ang').enable();
  610. Ext.getCmp('tilt_ang').enable();
  611. } else {
  612. Ext.getCmp('uart_id').disable();
  613. Ext.getCmp('prot_id').disable();
  614. Ext.getCmp('pan_mode').disable();
  615. Ext.getCmp('tilt_mode').disable();
  616. Ext.getCmp('pan_ang').disable();
  617. Ext.getCmp('tilt_ang').disable();
  618. };
  619. }
  620. }
  621. },{
  622. html: '&nbsp;'
  623. },{
  624. html: '{$Labels->GetLabel('_UART_PORT_')}'
  625. },{
  626. xtype: 'combo',
  627. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  628. lazyRender: true,
  629. id: 'uart_id',
  630. mode: 'local',
  631. forceSelection: true,
  632. triggerAction: 'all',
  633. editable: false,
  634. disableKeyFilter: true,
  635. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  636. store: new Ext.data.ArrayStore({
  637. fields: ['uart','uart_txt'],
  638. data: [{$UARTS}]
  639. }),
  640. valueField: 'uart',
  641. displayField: 'uart_txt',
  642. value: {$Cam['uart_id']},
  643. listeners:{
  644. select: function( a, c, b ){
  645. doCamOperation( {$CID}, 6, b );
  646. }
  647. }
  648. },{
  649. html: '&nbsp;'
  650. },{
  651. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  652. },{
  653. xtype: 'numberfield',
  654. id: 'prot_id',
  655. width: '95%',
  656. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  657. minValue: 0,
  658. maxValue: 255,
  659. value: {$Cam['protocol_aux']},
  660. listeners:{
  661. change: function( a, c, b ){
  662. doCamOperation( {$CID}, 7, c );
  663. }
  664. }
  665. },{
  666. html: '&nbsp;'
  667. },{
  668. html: 'Pan Model'
  669. },{
  670. xtype: 'combo',
  671. fieldLabel: 'Pan Model',
  672. lazyRender: true,
  673. id: 'pan_mode',
  674. disabled: ({$Cam['protocol']} == 0),
  675. mode: 'local',
  676. forceSelection: true,
  677. triggerAction: 'all',
  678. editable: false,
  679. disableKeyFilter: true,
  680. store: new Ext.data.ArrayStore({
  681. fields: ['pm','pm_txt'],
  682. data: [
  683. [0,'Regular'],
  684. [1,'Reversed']
  685. ]
  686. }),
  687. valueField: 'pm',
  688. displayField: 'pm_txt',
  689. value: {$Cam['pan_model']},
  690. listeners:{
  691. select: function( a, c, b ){
  692. doCamOperation( {$CID}, 8, b );
  693. }
  694. }
  695. },{
  696. html: '&nbsp;'
  697. },{
  698. html: 'Tottal Pan Angles'
  699. },{
  700. xtype: 'numberfield',
  701. id: 'pan_ang',
  702. width: '95%',
  703. disabled: ({$Cam['protocol']} == 0),
  704. minValue: 0,
  705. maxValue: 360,
  706. value: {$Cam['pan_angles']},
  707. listeners:{
  708. change: function( a, c, b ){
  709. doCamOperation( {$CID}, 9, c );
  710. }
  711. }
  712. },{
  713. html: '&nbsp;'
  714. },{
  715. html: 'Tilt Model'
  716. },{
  717. xtype: 'combo',
  718. fieldLabel: 'Tilt Model',
  719. lazyRender: true,
  720. id: 'tilt_mode',
  721. disabled: ({$Cam['protocol']} == 0),
  722. mode: 'local',
  723. forceSelection: true,
  724. triggerAction: 'all',
  725. editable: false,
  726. disableKeyFilter: true,
  727. store: new Ext.data.ArrayStore({
  728. fields: ['tm','tm_txt'],
  729. data: [
  730. [0,'Regular'],
  731. [1,'Reversed'],
  732. [2,'Shifted 90�'],
  733. [3,'Rev-Shifted 90�']
  734. ]
  735. }),
  736. valueField: 'tm',
  737. displayField: 'tm_txt',
  738. value: {$Cam['tilt_model']},
  739. listeners:{
  740. select: function( a, c, b ){
  741. doCamOperation( {$CID}, 10, b );
  742. }
  743. }
  744. },{
  745. html: '&nbsp;'
  746. },{
  747. html: 'Tottal Tilt Angles'
  748. },{
  749. xtype: 'numberfield',
  750. id: 'tilt_ang',
  751. width: '95%',
  752. disabled: ({$Cam['protocol']} == 0),
  753. minValue: 0,
  754. maxValue: 180,
  755. value: {$Cam['tilt_angles']},
  756. listeners:{
  757. change: function( a, c, b ){
  758. doCamOperation( {$CID}, 11, c );
  759. }
  760. }
  761. },{
  762. html: '&nbsp;'
  763. },{
  764. html: 'PTZ Auto Axeleration'
  765. },{
  766. xtype: 'checkbox',
  767. id: 'ptz_axel_c',
  768. disabled: ({$Cam['protocol']} == 0),
  769. checked: ({$Cam['ptz_axel']} < 5 ),
  770. listeners:{
  771. change: function( a, c, b ){
  772. if( c ){
  773. doCamOperation( {$CID}, 13, 0 );
  774. var zz = Ext.getCmp('ptz_axel');
  775. zz.disable();
  776. } else {
  777. var zz = Ext.getCmp('ptz_axel');
  778. zz.enable();
  779. var vava = zz.getValue();
  780. if( vava < 5 ){
  781. vava = 5;
  782. zz.setValue( vava, true );
  783. } else {
  784. doCamOperation( {$CID}, 13, vava );
  785. };
  786. var jj = Ext.getCmp('ptz_axel_d');
  787. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  788. };
  789. }
  790. }
  791. },{
  792. html: '&nbsp;'
  793. },{
  794. html: 'PTZ Manual Axeleration'
  795. },{
  796. xtype: 'slider',
  797. id: 'ptz_axel',
  798. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 5)),
  799. minValue: 5,
  800. maxValue: 20,
  801. value: {$Cam['ptz_axel']},
  802. listeners:{
  803. change: function( a, c, b ){
  804. doCamOperation( {$CID}, 13, c );
  805. var zz = Ext.getCmp('ptz_axel_d');
  806. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  807. }
  808. }
  809. },{
  810. id: 'ptz_axel_d',
  811. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  812. }]
  813. }]
  814. },{
  815. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  816. id: 'target_tab',
  817. frame: false,
  818. border: false,
  819. items:[{
  820. layout: 'table',
  821. frame: false,
  822. border: false,
  823. layoutConfig: {
  824. columns: 3
  825. },
  826. defaults: {
  827. frame: false,
  828. bodyStyle: 'padding:10px',
  829. border: false
  830. },
  831. items:[{
  832. width: 200,
  833. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  834. },{
  835. xtype: 'combo',
  836. lazyRender: true,
  837. id: 'cam_targeting',
  838. mode: 'local',
  839. forceSelection: true,
  840. triggerAction: 'all',
  841. editable: false,
  842. disableKeyFilter: true,
  843. store: new Ext.data.ArrayStore({
  844. fields: ['type','type_txt'],
  845. data: [
  846. [0,'Strict Visible Targets'],
  847. [1,'All Near'],
  848. [2,'ALL Far'],
  849. [3,'All Targets']
  850. ]
  851. }),
  852. value: {$Cam['trigger_mode']},
  853. valueField: 'type',
  854. displayField: 'type_txt',
  855. listeners:{
  856. select: function( a, c, b ){
  857. doCamOperation( {$CID}, 12, b );
  858. }
  859. }
  860. }]
  861. }]
  862. }]
  863. }
  864. PZAKSJEJSDKGJHGASD;
  865. $Data['status']='ok';
  866. if( $Cam['status'] == 0 ){
  867. $ADDCAMPOPO = '';
  868. } else {
  869. $ADDCAMPOPO = '';
  870. };
  871. if( $CAM_IP ){
  872. switch( $Cam['status'] ){
  873. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  874. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  875. };
  876. } else {
  877. $Data['content'] = $TPL_CAM_EDITOR;
  878. };
  879. } else {
  880. $Data['status']='error';
  881. };
  882. echo $Data['content'];
  883. } else {
  884. header('location: /');
  885. };
  886. ?>