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.

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