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.

1056 lines
27 KiB

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