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.

1038 lines
26 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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'], 'General' ) !== 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. $FU = '/video_feed/stream?id=';
  269. };
  270. $TPL_CAM_EDITOR=<<<PZAKSJEJSDKGJHGASD
  271. {
  272. id: 'camedi_tabs',
  273. xtype: 'tabpanel',
  274. activeTab: 0,
  275. bbar:[{$BBAR_BTN}],
  276. items: [{
  277. title: '{$Labels->GetLabel('_CAC_TAB_')}',
  278. id: 'cam_info',
  279. frame: false,
  280. border: false,
  281. items: [{
  282. xtype: 'panel',
  283. height: 290,
  284. border: false,
  285. frame: false,
  286. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  287. },{
  288. xtype: 'panel',
  289. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  290. },{
  291. xtype: 'form',
  292. labelWidth: 200,
  293. border: false,
  294. frame: false,
  295. labelAlign: 'right',
  296. items:[{
  297. xtype: 'checkbox',
  298. id: 'cam_manassign',
  299. fieldLabel: 'Static Connection',
  300. width: 200,
  301. checked: {$Cam['manual']},
  302. listeners:{
  303. check: function( a, c ){
  304. if( c ){
  305. doCamOperation( {$CID}, 17, 1 );
  306. } else {
  307. doCamOperation( {$CID}, 17, 0 );
  308. };
  309. }
  310. }
  311. }]
  312. }{$RESET_CREDENTIALS}]
  313. },{
  314. title: '{$Labels->GetLabel('_STREAMS_')}',
  315. id: 'str_tab',
  316. frame: false,
  317. border: false,
  318. items:[{
  319. xtype: 'grid',
  320. height: 124,
  321. id: 'nd_cam_grid',
  322. frame: false,
  323. ds: new Ext.data.ArrayStore({
  324. fields: ['id','name','size','encode','bitrate'],
  325. data: [{$STREAMS}]
  326. }),
  327. cm: new Ext.grid.ColumnModel({
  328. columns: [
  329. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  330. {header: "Name", dataIndex: 'name' },
  331. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  332. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  333. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  334. ],
  335. defaults: {
  336. sortable: false,
  337. menuDisabled: true,
  338. width: 100
  339. }
  340. }),
  341. sm: new Ext.grid.RowSelectionModel({
  342. singleSelect: true,
  343. listeners: {
  344. rowselect: function(sm, row, rec) {
  345. SelectedSource = rec.data.id;
  346. doCamOperation( {$CID}, 1, SelectedSource );
  347. var tt = Ext.getCmp('pic_prev');
  348. if( tt!= undefined ){
  349. //tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  350. tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
  351. };
  352. }
  353. }
  354. }),
  355. listeners:{
  356. viewready: function( t ){
  357. var tt = t.getSelectionModel();
  358. tt.selectRow({$SELECTED_STREAM});
  359. }
  360. }
  361. },{
  362. height: PanelH,
  363. id: 'pic_prev',
  364. html: '<center><img width="100%" src="/style/img/cam_cap0.png"></center>',
  365. listeners:{
  366. afterrender: function( t ){
  367. if( SelectedSource ){
  368. //t.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  369. };
  370. }
  371. }
  372. }],
  373. },{
  374. title: 'Lens Settings',
  375. id: 'lens_tab',
  376. frame: false,
  377. border: false,
  378. items:[{
  379. layout: 'table',
  380. frame: false,
  381. border: false,
  382. layoutConfig: {
  383. columns: 3
  384. },
  385. defaults: {
  386. frame: false,
  387. bodyStyle: 'padding:10px',
  388. border: false
  389. },
  390. items:[{
  391. width: 200,
  392. html: 'Sensor Size'
  393. },{
  394. xtype: 'combo',
  395. fieldLabel: 'Sensor Size',
  396. lazyRender: true,
  397. id: 'sens_size',
  398. mode: 'local',
  399. forceSelection: true,
  400. triggerAction: 'all',
  401. editable: false,
  402. disableKeyFilter: true,
  403. store: new Ext.data.ArrayStore({
  404. fields: ['size','size_txt'],
  405. data: [
  406. [0,'1/3.6"'],
  407. [1,'1/3.2"'],
  408. [2,'1/3"'],
  409. [3,'1/2.7"'],
  410. [4,'1/2"'],
  411. [5,'1/1.8"'],
  412. [6,'2/3"'],
  413. [7,'1"'],
  414. [8,'4/3"'],
  415. [9,'APS-C'],
  416. [10,'35 mm'],
  417. [11,'645']
  418. ]
  419. }),
  420. valueField: 'size',
  421. displayField: 'size_txt',
  422. value: {$Cam['imager_type']},
  423. listeners:{
  424. select:function( c, r, i ){
  425. doCamOperation( {$CID}, 2, i );
  426. }
  427. }
  428. },{
  429. html: '&nbsp;'
  430. },{
  431. html: 'Focal Length'
  432. },{
  433. xtype: 'combo',
  434. fieldLabel: 'Lens Focal Length',
  435. lazyRender: true,
  436. id: 'lens_fl',
  437. mode: 'local',
  438. forceSelection: true,
  439. triggerAction: 'all',
  440. editable: false,
  441. disableKeyFilter: true,
  442. store: new Ext.data.ArrayStore({
  443. fields: ['fl','fl_txt'],
  444. data: [
  445. [0,'2.7 mm.'],
  446. [1,'3.0 mm.'],
  447. [2,'3.2 mm.'],
  448. [3,'3.5 mm.'],
  449. [4,'3.7 mm.'],
  450. [5,'3.9 mm.'],
  451. [6,'4.0 mm.'],
  452. [7,'4.3 mm.'],
  453. [8,'4.8 mm.'],
  454. [9,'5.0 mm.'],
  455. [10,'5.1 mm.'],
  456. [11,'5.5 mm.'],
  457. [12,'5.8 mm.'],
  458. [13,'6.0 mm.'],
  459. [14,'6.2 mm.'],
  460. [15,'6.6 mm.'],
  461. [16,'7.0 mm.'],
  462. [17,'7.1 mm.'],
  463. [18,'7.5 mm.'],
  464. [19,'7.6 mm.'],
  465. [20,'8.0 mm.'],
  466. [21,'8.6 mm.'],
  467. [22,'8.9 mm.'],
  468. [23,'9.0 mm.'],
  469. [24,'9.2 mm.'],
  470. [25,'9.3 mm.'],
  471. [26,'10.0 mm.'],
  472. [27,'10.5 mm.'],
  473. [28,'10.6 mm.'],
  474. [29,'10.7 mm.'],
  475. [30,'11.0 mm.'],
  476. [31,'11.3 mm.'],
  477. [32,'12.0 mm.'],
  478. [33,'12.9 mm.'],
  479. [34,'13.0 mm.'],
  480. [35,'13.5 mm.'],
  481. [36,'13.6 mm.'],
  482. [37,'14.0 mm.'],
  483. [38,'14.6 mm.'],
  484. [39,'15.0 mm.'],
  485. [40,'15.1 mm.'],
  486. [41,'15.5 mm.'],
  487. [42,'16.0 mm.'],
  488. [43,'17.0 mm.'],
  489. [44,'17.5 mm.'],
  490. [44,'17.7 mm.'],
  491. [45,'18.0 mm.'],
  492. [46,'18.2 mm.'],
  493. [47,'19.0 mm.']
  494. ]
  495. }),
  496. valueField: 'fl',
  497. displayField: 'fl_txt',
  498. value: {$Cam['lens_f']},
  499. listeners:{
  500. select:function( c, r, i ){
  501. doCamOperation( {$CID}, 3, i );
  502. }
  503. }
  504. },{
  505. html: '&nbsp;'
  506. },{
  507. html: 'Fixed Zoom'
  508. },{
  509. xtype: 'radio',
  510. id: 'no_zoom',
  511. name: 'zoom_ena',
  512. value: ( parseFloat({$Cam['zoom']})==0 ),
  513. checked: ( parseFloat({$Cam['zoom']})==0 ),
  514. listeners:{
  515. change: function( r, n, o ){
  516. if( n ) {
  517. doCamOperation( {$CID}, 4, 0.0 );
  518. };
  519. }
  520. }
  521. },{
  522. html: '&nbsp;'
  523. },{
  524. html: 'Variable Zoom'
  525. },{
  526. xtype: 'radio',
  527. id: 'on_zoom',
  528. hideLabel: false,
  529. fieldLabel: 'Variable Zoom',
  530. name: 'zoom_ena',
  531. value: ({$Cam['zoom']}>0.0),
  532. checked: ({$Cam['zoom']}>0.0),
  533. handler: function( a, c ){
  534. if( c ){
  535. Ext.getCmp('zoom_val').enable();
  536. Ext.getCmp('zoom_val').setValue( 1 );
  537. var zz = Ext.getCmp('zoom_d');
  538. if( zz.rendered ) zz.update('<p>X&nbsp;1</p>');
  539. } else {
  540. Ext.getCmp('zoom_val').disable();
  541. var zz = Ext.getCmp('zoom_d');
  542. if( zz.rendered ) zz.update('&nbsp;');
  543. };
  544. },
  545. listeners:{
  546. change: function( r, n, o ){
  547. if( n ) {
  548. doCamOperation( {$CID}, 4, 1.0 );
  549. };
  550. }
  551. }
  552. },{
  553. html: '&nbsp;'
  554. },{
  555. html: 'Zoom Ratio'
  556. },{
  557. xtype: 'slider',
  558. id: 'zoom_val',
  559. disabled: ( parseFloat({$Cam['zoom']})==0 ),
  560. minValue: 1.0,
  561. maxValue: 40.0,
  562. value: {$Cam['zoom']},
  563. listeners:{
  564. change: function( a, c, b ){
  565. doCamOperation( {$CID}, 4, c );
  566. var zz = Ext.getCmp('zoom_d');
  567. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  568. }
  569. }
  570. },{
  571. id: 'zoom_d',
  572. html: (( parseFloat({$Cam['zoom']})==0 )?'&nbsp;':'<p>X&nbsp;'+ {$Cam['zoom']} + '</p>' )
  573. }]
  574. }]
  575. },{
  576. title: '{$Labels->GetLabel('_PTZ_TAB_')}',
  577. id: 'ptz_tab',
  578. frame: false,
  579. border: false,
  580. items:[{
  581. layout: 'table',
  582. frame: false,
  583. border: false,
  584. layoutConfig: {
  585. columns: 3
  586. },
  587. defaults: {
  588. frame: false,
  589. bodyStyle: 'padding:10px',
  590. border: false
  591. },
  592. items:[{
  593. width: 200,
  594. html: '{$Labels->GetLabel('__PTZ_CONTROL__')}'
  595. },{
  596. xtype: 'combo',
  597. fieldLabel: '{$Labels->GetLabel('__PTZ_CONTROL__')}',
  598. lazyRender: true,
  599. id: 'ptz_proto',
  600. mode: 'local',
  601. forceSelection: true,
  602. triggerAction: 'all',
  603. editable: false,
  604. disableKeyFilter: true,
  605. store: new Ext.data.ArrayStore({
  606. fields: ['type','type_txt'],
  607. data: [
  608. [0,'{$Labels->GetLabel('_NO_PTZ_')}'],
  609. [1,'Sony VISCA'],
  610. [2,'Pelco-D'],
  611. [3,'OnVif'],
  612. [4,'PSIA'],
  613. [5,'GB/T28181']
  614. ]
  615. }),
  616. value: {$Cam['protocol']},
  617. valueField: 'type',
  618. displayField: 'type_txt',
  619. listeners:{
  620. select: function( a, c, b ){
  621. doCamOperation( {$CID}, 5, b );
  622. if( b > 0 ){
  623. if( b != 3 ){
  624. Ext.getCmp('uart_id').enable();
  625. Ext.getCmp('prot_id').enable();
  626. } else {
  627. Ext.getCmp('uart_id').disable();
  628. Ext.getCmp('prot_id').disable();
  629. };
  630. Ext.getCmp('pan_mode').enable();
  631. Ext.getCmp('tilt_mode').enable();
  632. Ext.getCmp('pan_ang').enable();
  633. Ext.getCmp('tilt_ang').enable();
  634. } else {
  635. Ext.getCmp('uart_id').disable();
  636. Ext.getCmp('prot_id').disable();
  637. Ext.getCmp('pan_mode').disable();
  638. Ext.getCmp('tilt_mode').disable();
  639. Ext.getCmp('pan_ang').disable();
  640. Ext.getCmp('tilt_ang').disable();
  641. };
  642. }
  643. }
  644. },{
  645. html: '&nbsp;'
  646. },{
  647. html: '{$Labels->GetLabel('_UART_PORT_')}'
  648. },{
  649. xtype: 'combo',
  650. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  651. lazyRender: true,
  652. id: 'uart_id',
  653. mode: 'local',
  654. forceSelection: true,
  655. triggerAction: 'all',
  656. editable: false,
  657. disableKeyFilter: true,
  658. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  659. store: new Ext.data.ArrayStore({
  660. fields: ['uart','uart_txt'],
  661. data: [{$UARTS}]
  662. }),
  663. valueField: 'uart',
  664. displayField: 'uart_txt',
  665. value: {$Cam['uart_id']},
  666. listeners:{
  667. select: function( a, c, b ){
  668. doCamOperation( {$CID}, 6, b );
  669. }
  670. }
  671. },{
  672. html: '&nbsp;'
  673. },{
  674. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  675. },{
  676. xtype: 'numberfield',
  677. id: 'prot_id',
  678. width: '95%',
  679. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  680. minValue: 0,
  681. maxValue: 255,
  682. value: {$Cam['protocol_aux']},
  683. listeners:{
  684. change: function( a, c, b ){
  685. doCamOperation( {$CID}, 7, c );
  686. }
  687. }
  688. },{
  689. html: '&nbsp;'
  690. },{
  691. html: 'Pan Model'
  692. },{
  693. xtype: 'combo',
  694. fieldLabel: 'Pan Model',
  695. lazyRender: true,
  696. id: 'pan_mode',
  697. disabled: ({$Cam['protocol']} == 0),
  698. mode: 'local',
  699. forceSelection: true,
  700. triggerAction: 'all',
  701. editable: false,
  702. disableKeyFilter: true,
  703. store: new Ext.data.ArrayStore({
  704. fields: ['pm','pm_txt'],
  705. data: [
  706. [0,'Regular'],
  707. [1,'Reversed']
  708. ]
  709. }),
  710. valueField: 'pm',
  711. displayField: 'pm_txt',
  712. value: {$Cam['pan_model']},
  713. listeners:{
  714. select: function( a, c, b ){
  715. doCamOperation( {$CID}, 8, b );
  716. }
  717. }
  718. },{
  719. html: '&nbsp;'
  720. },{
  721. html: 'Tottal Pan Angles'
  722. },{
  723. xtype: 'numberfield',
  724. id: 'pan_ang',
  725. width: '95%',
  726. disabled: ({$Cam['protocol']} == 0),
  727. minValue: 0,
  728. maxValue: 360,
  729. value: {$Cam['pan_angles']},
  730. listeners:{
  731. change: function( a, c, b ){
  732. doCamOperation( {$CID}, 9, c );
  733. }
  734. }
  735. },{
  736. html: '&nbsp;'
  737. },{
  738. html: 'Tilt Model'
  739. },{
  740. xtype: 'combo',
  741. fieldLabel: 'Tilt Model',
  742. lazyRender: true,
  743. id: 'tilt_mode',
  744. disabled: ({$Cam['protocol']} == 0),
  745. mode: 'local',
  746. forceSelection: true,
  747. triggerAction: 'all',
  748. editable: false,
  749. disableKeyFilter: true,
  750. store: new Ext.data.ArrayStore({
  751. fields: ['tm','tm_txt'],
  752. data: [
  753. [0,'Regular'],
  754. [1,'Reversed'],
  755. [2,'Shifted 90�'],
  756. [3,'Rev-Shifted 90�']
  757. ]
  758. }),
  759. valueField: 'tm',
  760. displayField: 'tm_txt',
  761. value: {$Cam['tilt_model']},
  762. listeners:{
  763. select: function( a, c, b ){
  764. doCamOperation( {$CID}, 10, b );
  765. }
  766. }
  767. },{
  768. html: '&nbsp;'
  769. },{
  770. html: 'Tottal Tilt Angles'
  771. },{
  772. xtype: 'numberfield',
  773. id: 'tilt_ang',
  774. width: '95%',
  775. disabled: ({$Cam['protocol']} == 0),
  776. minValue: 0,
  777. maxValue: 180,
  778. value: {$Cam['tilt_angles']},
  779. listeners:{
  780. change: function( a, c, b ){
  781. doCamOperation( {$CID}, 11, c );
  782. }
  783. }
  784. },{
  785. html: '&nbsp;'
  786. },{
  787. html: 'PTZ Auto Axeleration'
  788. },{
  789. xtype: 'checkbox',
  790. id: 'ptz_axel_c',
  791. disabled: ({$Cam['protocol']} == 0),
  792. checked: ({$Cam['ptz_axel']} < 6 ),
  793. listeners:{
  794. check: function( a, c ){
  795. if( c ){
  796. doCamOperation( {$CID}, 13, 0 );
  797. var zz = Ext.getCmp('ptz_axel');
  798. zz.disable();
  799. } else {
  800. var zz = Ext.getCmp('ptz_axel');
  801. zz.enable();
  802. var vava = zz.getValue();
  803. if( vava < 5 ){
  804. vava = 5;
  805. zz.setValue( vava, true );
  806. } else {
  807. doCamOperation( {$CID}, 13, vava );
  808. };
  809. var jj = Ext.getCmp('ptz_axel_d');
  810. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  811. };
  812. }
  813. }
  814. },{
  815. html: '&nbsp;'
  816. },{
  817. html: 'PTZ Manual Axeleration'
  818. },{
  819. xtype: 'slider',
  820. id: 'ptz_axel',
  821. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 6)),
  822. minValue: 5,
  823. maxValue: 20,
  824. value: {$Cam['ptz_axel']},
  825. listeners:{
  826. change: function( a, c, b ){
  827. doCamOperation( {$CID}, 13, c );
  828. var zz = Ext.getCmp('ptz_axel_d');
  829. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  830. }
  831. }
  832. },{
  833. id: 'ptz_axel_d',
  834. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  835. },{
  836. html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  837. },{
  838. xtype: 'numberfield',
  839. decimalPrecision: 3,
  840. value: {$Cam['x_rot']},
  841. listeners:{
  842. change: function( a, c, b ){
  843. doCamOperation( {$CID}, 14, c );
  844. }
  845. }
  846. },{
  847. html: '&nbsp;'
  848. },{
  849. html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  850. },{
  851. xtype: 'numberfield',
  852. decimalPrecision: 3,
  853. value: {$Cam['y_rot']},
  854. listeners:{
  855. change: function( a, c, b ){
  856. doCamOperation( {$CID}, 15, c );
  857. }
  858. }
  859. },{
  860. html: '&nbsp;'
  861. },{
  862. html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  863. },{
  864. xtype: 'numberfield',
  865. decimalPrecision: 3,
  866. value: {$Cam['z_rot']},
  867. listeners:{
  868. change: function( a, c, b ){
  869. doCamOperation( {$CID}, 16, c );
  870. }
  871. }
  872. },{
  873. html: '&nbsp;'
  874. },{
  875. html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  876. },{
  877. xtype: 'numberfield',
  878. decimalPrecision: 3,
  879. value: {$Cam['x']},
  880. listeners:{
  881. change: function( a, c, b ){
  882. doCamOperation( {$CID}, 17, c );
  883. }
  884. }
  885. },{
  886. html: '&nbsp;'
  887. },{
  888. html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  889. },{
  890. xtype: 'numberfield',
  891. decimalPrecision: 3,
  892. value: {$Cam['y']},
  893. listeners:{
  894. change: function( a, c, b ){
  895. doCamOperation( {$CID}, 18, c );
  896. }
  897. }
  898. },{
  899. html: '&nbsp;'
  900. },{
  901. html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
  902. },{
  903. xtype: 'numberfield',
  904. decimalPrecision: 3,
  905. value: {$Cam['z']},
  906. listeners:{
  907. change: function( a, c, b ){
  908. doCamOperation( {$CID}, 19, c );
  909. }
  910. }
  911. },{
  912. html: '&nbsp;'
  913. }]
  914. }]
  915. },{
  916. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  917. id: 'target_tab',
  918. frame: false,
  919. border: false,
  920. items:[{
  921. layout: 'table',
  922. frame: false,
  923. border: false,
  924. layoutConfig: {
  925. columns: 3
  926. },
  927. defaults: {
  928. frame: false,
  929. bodyStyle: 'padding:10px',
  930. border: false
  931. },
  932. items:[{
  933. width: 200,
  934. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  935. },{
  936. xtype: 'combo',
  937. lazyRender: true,
  938. id: 'cam_targeting',
  939. mode: 'local',
  940. forceSelection: true,
  941. triggerAction: 'all',
  942. editable: false,
  943. disableKeyFilter: true,
  944. store: new Ext.data.ArrayStore({
  945. fields: ['type','type_txt'],
  946. data: [
  947. [0,'Strict Visible Targets'],
  948. [1,'All Near'],
  949. [2,'ALL Far'],
  950. [3,'All Targets']
  951. ]
  952. }),
  953. value: {$Cam['trigger_mode']},
  954. valueField: 'type',
  955. displayField: 'type_txt',
  956. listeners:{
  957. select: function( a, c, b ){
  958. doCamOperation( {$CID}, 12, b );
  959. }
  960. }
  961. },{
  962. xtype: 'spacer'
  963. },{
  964. width: 200,
  965. html: 'Enable Automatic Home Return'
  966. },{
  967. xtype: 'checkbox',
  968. id: 'cam_horeten',
  969. fieldLabel: '',
  970. width: 200,
  971. checked: {$Cam['homing_enable']},
  972. listeners:{
  973. check: function( a, c ){
  974. if( c ){
  975. doCamOperation( {$CID}, 18, 1 );
  976. } else {
  977. doCamOperation( {$CID}, 18, 0 );
  978. };
  979. }
  980. }
  981. },{
  982. xtype: 'spacer'
  983. },{
  984. width: 200,
  985. html: 'Time After Alarm'
  986. },{
  987. xtype: 'numberfield',
  988. id: 'cam_horetto',
  989. width: 200,
  990. value: '{$Cam['homing_to']}',
  991. listeners:{
  992. change: function( a, c, b ){
  993. doCamOperation( {$CID}, 19, c );
  994. }
  995. }
  996. },{
  997. xtype: 'spacer'
  998. },{
  999. width: 200,
  1000. html: 'Home Preset Token'
  1001. },{
  1002. xtype: 'textfield',
  1003. id: 'cam_horettk',
  1004. fieldLabel: '',
  1005. width: 200,
  1006. value: '{$Cam['home_token']}',
  1007. readOnly: true
  1008. },{
  1009. xtype: 'spacer'
  1010. }]
  1011. }]
  1012. }]
  1013. }
  1014. PZAKSJEJSDKGJHGASD;
  1015. $Data['status']='ok';
  1016. if( $Cam['status'] == 0 ){
  1017. $ADDCAMPOPO = '';
  1018. } else {
  1019. $ADDCAMPOPO = '';
  1020. };
  1021. if( $CAM_IP ){
  1022. switch( $Cam['status'] ){
  1023. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  1024. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  1025. };
  1026. } else {
  1027. $Data['content'] = $TPL_CAM_EDITOR;
  1028. };
  1029. } else {
  1030. $Data['status']='error';
  1031. };
  1032. echo $Data['content'];
  1033. } else {
  1034. header('location: /');
  1035. };
  1036. ?>