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.

784 lines
19 KiB

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