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.

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