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.

1579 lines
46 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
​
​
​
​
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
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 * FROM `nodes` WHERE `type`>9 AND `type`<16 AND `aux_id`={$CID}";
  14. $JJ = $DATABASE->Query( $QS );
  15. $Node = $JJ[0];
  16. $Cam['node_name'] = $Node['name'];
  17. $Cam['name']=urldecode( $Cam['name'] );
  18. $TB = explode( ' ', $Cam['name'] );
  19. $Cam['name'] = $TB[0];
  20. if( stripos($Cam['ip'],'/dev/video') !==false ){
  21. $CLS = "camera_analog_set";
  22. $CAM_IP = false;
  23. } else {
  24. $CAM_IP = true;
  25. $CamLabel = $Cam['name'] . '_' . $CID;
  26. if( stripos( $Cam['name'], 'hikvision' ) !== false ){
  27. $CLS = "camera_hikvision_set";
  28. } elseif( stripos( $Cam['name'], 'dahua' ) !== false ){
  29. $CLS = "camera_dahua_set";
  30. } elseif( stripos( $Cam['name'], 'axis' ) !== false ){
  31. $CLS = "camera_axis_set";
  32. } elseif( stripos( $Cam['name'], 'General' ) !== false ){
  33. $CLS = "cam_vehicle_set";
  34. } else {
  35. $CLS = "camera_generic_set";
  36. };
  37. };
  38. $QS = "SELECT * FROM media_streams WHERE source_id={$CID}";
  39. $Result = $DATABASE->Query($QS,false);
  40. $SELECTED_STREAM = 0;
  41. $STREAMS = array();
  42. if( count( $Result ) > 0 ){
  43. $ii = 0;
  44. foreach( $Result as $CD ){
  45. $STREAMS[] = "[{$CD['id']},'{$CD['name']}','{$CD['img_width']}x{$CD['img_height']}@{$CD['fps']}','{$CD['compression_type']}',{$CD['bitrate']}]";
  46. if( $Cam['stream_id'] == $CD['id'] ) $SELECTED_STREAM = $ii;
  47. $ii++;
  48. };
  49. };
  50. $STREAMS = implode(',',$STREAMS);
  51. $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 ) ORDER BY re.aux_id";
  52. $RR=$DATABASE->Query( $QS );
  53. if( count( $RR ) ){
  54. $RE=array();
  55. foreach( $RR as $R ){
  56. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  57. };
  58. $UARTS = implode( ',', $RE );
  59. } else {
  60. $UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  61. };
  62. $ATAB = 0;
  63. //v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=1 --stream-to=output.jpg
  64. $QS = "SELECT `no`.`id`, `sen`.`type`, `sen`.`max_range`, `no`.`enable`, `no`.`name` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`)";
  65. $Result = $DATABASE->Query( $QS, false );
  66. $SENSORS = array();
  67. $SENSOID = 0;
  68. if( count( $Result ) ){
  69. $SenPart = array();
  70. foreach( $Result as $R ){
  71. switch( $R['type'] ){
  72. case 1: $HWT = 'ALS ' . $R['max_range'] . ' meters'; break;
  73. case 2: $HWT = 'LFS ' . $R['max_range'] . ' meters'; break;
  74. case 3: $HWT = 'PLS200 ' . $R['max_range'] . ' meters'; break;
  75. case 4: $HWT = 'PLS360 ' . $R['max_range'] . ' meters'; break;
  76. case 5: $HWT = '3DLRF ' . $R['max_range'] . ' meters'; break;
  77. };
  78. $SenPart[] = '[ '.$R['id'].',\''.$R['name'].'('.$HWT.')\']';
  79. };
  80. $SENSORS = '['.implode( ',', $SenPart ) .']';
  81. if( $SENSOID == 0 ) $SENSOID = intval( $R['id'] );
  82. } else {
  83. $SENSORS ='[ [ 0, \'--No Sensors Defined--\']]';
  84. };
  85. if( $CAM_IP ){
  86. $RESET_CREDENTIALS=<<<kskjhiiuwye
  87. ,{
  88. xtype: 'button',
  89. width: '100%',
  90. text: '{$Labels->GetLabel('_RSET_CREDENTIALS_')}',
  91. handler: function(){
  92. }
  93. }
  94. kskjhiiuwye;
  95. } else {
  96. $RESET_CREDENTIALS='';
  97. };
  98. if( $Cam['status'] < 3 ){
  99. $ADD_CAMERA=<<<hzzhoiuyhetrkh
  100. {
  101. xtype: 'button',
  102. width: '100%',
  103. text: '{$Labels->GetLabel('_ASSIGN_CAMERA_')}',
  104. handler: function(){
  105. Ext.Ajax.request({
  106. url: '/lib/controller/doCameraOperation.php',
  107. params: {
  108. UID: {$UserID},
  109. SID: '{$Session}',
  110. CMD: 2,
  111. CID: {$CID}
  112. },
  113. success: function( response, opts ){
  114. var tData = Ext.decode(response.responseText);
  115. if( tData.status == 'ok' ){
  116. loadDetectedCameras();
  117. } else {
  118. Ext.Msg.show({
  119. title:'{$Labels->GetLabel('_ERROR_')}',
  120. msg: tData.msg,
  121. buttons: Ext.Msg.OK,
  122. icon: Ext.MessageBox.ERROR
  123. });
  124. };
  125. },
  126. failure: failureAJAXFunction
  127. });
  128. }
  129. }
  130. hzzhoiuyhetrkh;
  131. } else {
  132. $RESET_CREDENTIALS='';
  133. $ADD_CAMERA=<<<hhoiuyhetrkh
  134. {
  135. xtype: 'button',
  136. width: '100%',
  137. text: '{$Labels->GetLabel('_REMOVE_CAMERA_')}',
  138. handler: function(){
  139. Ext.Ajax.request({
  140. url: '/lib/controller/doCameraOperation.php',
  141. params: {
  142. UID: {$UserID},
  143. SID: '{$Session}',
  144. CMD: 7,
  145. CID: {$CID}
  146. },
  147. success: function( response, opts ){
  148. var tData = Ext.decode(response.responseText);
  149. if( tData.status == 'ok' ){
  150. loadAssignedCameras();
  151. } else {
  152. Ext.Msg.show({
  153. title:'Error!',
  154. msg: tData.msg,
  155. buttons: Ext.Msg.OK,
  156. icon: Ext.MessageBox.ERROR
  157. });
  158. };
  159. },
  160. failure: failureAJAXFunction
  161. });
  162. }
  163. }
  164. hhoiuyhetrkh;
  165. };
  166. $BBAR_BTN = $ADD_CAMERA;
  167. $TPL_SET_CREDS_IP=<<<ZUZAKA
  168. {
  169. xtype: 'form',
  170. id: 'cam_credentials',
  171. labelWidth: 260,
  172. labelAlign: 'right',
  173. items: [{
  174. xtype: 'panel',
  175. height: 290,
  176. border: false,
  177. frame: false,
  178. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  179. },{
  180. xtype: 'panel',
  181. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  182. },{
  183. xtype: 'panel',
  184. html: '<div class="sideInfo_item" id="INFO_ID">{$Labels->GetLabel('_PROV_CAC_')}</div>'
  185. },{
  186. xtype: 'textfield',
  187. id: 'cam_login',
  188. fieldLabel: '{$Labels->GetLabel('__LOGIN__')}',
  189. width: 200
  190. },{
  191. xtype: 'textfield',
  192. id: 'cam_password',
  193. inputType: 'password',
  194. fieldLabel: '{$Labels->GetLabel('__PASSWORD__')}',
  195. width: 200
  196. },{
  197. xtype: 'combo',
  198. id: 'cam_auth_mode',
  199. fieldLabel: '{$Labels->GetLabel('_AUTH_MODE_0_')}',
  200. lazyRender: true,
  201. mode: 'local',
  202. forceSelection: true,
  203. triggerAction: 'all',
  204. editable: false,
  205. disableKeyFilter: true,
  206. store: new Ext.data.ArrayStore({
  207. fields: ['mode','mode_txt'],
  208. data: [
  209. [0,'BASIC'],
  210. [1,'DIGEST'],
  211. [2,'DIGEST_IE'],
  212. [3,'BEARER'],
  213. [4,'NEGOTIATE'],
  214. [5,'NTLM'],
  215. [6,'NTLM_WB'],
  216. [7,'ANY'],
  217. [8,'ANYSAFE'],
  218. [9,'ONLY'],
  219. [10,'AWS_SIGV4']
  220. ]
  221. }),
  222. valueField: 'mode',
  223. displayField: 'mode_txt',
  224. value: 0,
  225. width: 200
  226. },{
  227. xtype: 'button',
  228. width: '100%',
  229. text: '{$Labels->GetLabel('_SET_CREDENTIALS_')}',
  230. handler: function(){
  231. addDetCamWM = new Ext.LoadMask( Ext.getCmp('cam_credentials').getEl(), {msg:"{$Labels->GetLabel('_Please_Wait_')}..."});
  232. addDetCamWM.show();
  233. var NUU = Ext.getCmp('cam_login').getValue();
  234. var NPP = Ext.getCmp('cam_password').getValue();
  235. var NAM = Ext.getCmp('cam_auth_mode').getValue();
  236. Ext.Ajax.request({
  237. url: '/lib/controller/doCameraOperation.php',
  238. params: {
  239. UID: {$UserID},
  240. SID: '{$Session}',
  241. CID: {$CID},
  242. UU: NUU,
  243. PP: NPP,
  244. AU: NAM,
  245. CMD: 3
  246. },
  247. success: function( response, opts ){
  248. addDetCamWM.hide();
  249. var data = Ext.decode(response.responseText);
  250. if( data.status == 'ok' ){
  251. loadDetectedCameras();
  252. } else {
  253. Ext.Msg.show({
  254. title:'Error!',
  255. msg: data.msg,
  256. buttons: Ext.Msg.OK,
  257. icon: Ext.MessageBox.WARNING
  258. });
  259. };
  260. },
  261. failure: failureAJAXFunction
  262. });
  263. }
  264. }]
  265. }
  266. ZUZAKA;
  267. $TPL_ANALOG_CAM =<<<CHUPAKABRA
  268. {
  269. xtype: 'panel',
  270. id: 'cam_info',
  271. labelWidth: 260,
  272. labelAlign: 'right',
  273. bbar:[{$BBAR_BTN}],
  274. items: [{
  275. xtype: 'panel',
  276. height: 290,
  277. border: false,
  278. frame: false,
  279. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  280. },{
  281. xtype: 'panel',
  282. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  283. }]
  284. }
  285. CHUPAKABRA;
  286. //$QS="SELECT * FROM `module_eve` WHERE `id`=1";
  287. //$S=$DATABASE->Query( $QS );
  288. //$MODULE_DATA = $S[0];
  289. if( $Cam['status'] < 3 ){
  290. $FU = "/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID=";
  291. } else {
  292. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id=';
  293. $FU = '/video_feed/stream?id=';
  294. };
  295. $TPL_CAM_EDITOR=<<<PZAKSJEJSDKGJHGASD
  296. {
  297. id: 'camedi_tabs',
  298. xtype: 'tabpanel',
  299. activeTab: 0,
  300. bbar:[{$BBAR_BTN}],
  301. items: [{
  302. title: '{$Labels->GetLabel('_CAC_TAB_')}',
  303. id: 'cam_info',
  304. frame: false,
  305. border: false,
  306. items: [{
  307. xtype: 'panel',
  308. height: 290,
  309. border: false,
  310. frame: false,
  311. html: '<table width="100%" border=0><tr><td height=290 align="center"><div class="{$CLS}"></div></td>'
  312. },{
  313. xtype: 'panel',
  314. html: '<div class="sideInfo_item" id="INFO_ON"><b>{$Cam['ip']}</b><br/>{$Cam['name']}<br/>{$Cam['hardware']}</div>'
  315. },{
  316. xtype: 'form',
  317. labelWidth: 200,
  318. border: false,
  319. frame: false,
  320. labelAlign: 'right',
  321. items:[{
  322. xtype: 'checkbox',
  323. id: 'cam_manassign',
  324. fieldLabel: '{$Labels->GetLabel('_STATIC_CONNECTION_')}',
  325. width: 200,
  326. checked: {$Cam['manual']},
  327. listeners:{
  328. check: function( a, c ){
  329. if( c ){
  330. doCamOperation( {$CID}, 24, 1 );
  331. } else {
  332. doCamOperation( {$CID}, 24, 0 );
  333. };
  334. }
  335. }
  336. }]
  337. }{$RESET_CREDENTIALS}]
  338. },{
  339. title: '{$Labels->GetLabel('_STREAMS_')}',
  340. id: 'str_tab',
  341. frame: false,
  342. border: false,
  343. items:[{
  344. xtype: 'grid',
  345. height: 124,
  346. id: 'nd_cam_grid',
  347. frame: false,
  348. ds: new Ext.data.ArrayStore({
  349. fields: ['id','name','size','encode','bitrate'],
  350. data: [{$STREAMS}]
  351. }),
  352. cm: new Ext.grid.ColumnModel({
  353. columns: [
  354. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  355. {header: "Name", dataIndex: 'name' },
  356. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  357. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  358. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  359. ],
  360. defaults: {
  361. sortable: false,
  362. menuDisabled: true,
  363. width: 100
  364. }
  365. }),
  366. sm: new Ext.grid.RowSelectionModel({
  367. singleSelect: true,
  368. listeners: {
  369. rowselect: function(sm, row, rec) {
  370. SelectedSource = rec.data.id;
  371. doCamOperation( {$CID}, 1, SelectedSource );
  372. var tt = Ext.getCmp('pic_prev');
  373. if( tt!= undefined ){
  374. //tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  375. tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
  376. };
  377. }
  378. }
  379. }),
  380. listeners:{
  381. viewready: function( t ){
  382. var tt = t.getSelectionModel();
  383. tt.selectRow({$SELECTED_STREAM});
  384. }
  385. }
  386. },{
  387. height: PanelH,
  388. id: 'pic_prev',
  389. html: '<center><img width="100%" src="/style/img/cam_cap0.png"></center>',
  390. listeners:{
  391. afterrender: function( t ){
  392. if( SelectedSource ){
  393. //t.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  394. };
  395. }
  396. }
  397. }],
  398. },{
  399. title: '{$Labels->GetLabel('_CAM_LENS_SETTINGS_')}',
  400. id: 'lens_tab',
  401. frame: false,
  402. border: false,
  403. items:[{
  404. layout: 'table',
  405. frame: false,
  406. border: false,
  407. layoutConfig: {
  408. columns: 3
  409. },
  410. defaults: {
  411. frame: false,
  412. bodyStyle: 'padding:10px',
  413. border: false
  414. },
  415. items:[{
  416. html: '{$Labels->GetLabel('_CAM_ZOOMMO_')}'
  417. },{
  418. xtype: 'combo',
  419. fieldLabel: '{$Labels->GetLabel('_CAM_ZOOMMO_')}',
  420. lazyRender: true,
  421. id: 'zoom_mo',
  422. mode: 'local',
  423. forceSelection: true,
  424. triggerAction: 'all',
  425. editable: false,
  426. disableKeyFilter: true,
  427. store: new Ext.data.ArrayStore({
  428. fields: ['zm','zm_txt'],
  429. data: [
  430. [0,'{$Labels->GetLabel('_CAM_FIXEDZ_')}'],
  431. [1,'{$Labels->GetLabel('_CAM_CUSTOMZ_')}'],
  432. [2,'{$Labels->GetLabel('_CAM_VARIOZ_')}']
  433. ]
  434. }),
  435. valueField: 'zm',
  436. displayField: 'zm_txt',
  437. value: {$Cam['zoom_model']},
  438. listeners:{
  439. select:function( c, r, i ){
  440. doCamOperation( {$CID}, 21, i );
  441. switch( i ){
  442. case 0:{
  443. Ext.getCmp('lbbel0').show();
  444. Ext.getCmp('sens_size').show();
  445. Ext.getCmp('empty0').show();
  446. Ext.getCmp('lbbel11').show();
  447. Ext.getCmp('lens_fl').show();
  448. Ext.getCmp('empty1').show();
  449. Ext.getCmp('lbbel1').hide();
  450. Ext.getCmp('zoom_val').hide();
  451. Ext.getCmp('zoom_d').hide();
  452. Ext.getCmp('lbbel2').hide();
  453. Ext.getCmp('zoom_val2').hide();
  454. Ext.getCmp('zoom_d2').hide();
  455. Ext.getCmp('lbbel3').hide();
  456. Ext.getCmp('zoom_range1').hide();
  457. Ext.getCmp('empup_2').hide();
  458. Ext.getCmp('zoom_perc1').hide();
  459. Ext.getCmp('lbbel4').hide();
  460. Ext.getCmp('empup_3').hide();
  461. break;
  462. };
  463. case 1:{
  464. Ext.getCmp('lbbel2').hide();
  465. Ext.getCmp('zoom_val2').hide();
  466. Ext.getCmp('zoom_d2').hide();
  467. Ext.getCmp('lbbel3').hide();
  468. Ext.getCmp('zoom_range1').hide();
  469. Ext.getCmp('empup_2').hide();
  470. Ext.getCmp('zoom_perc1').hide();
  471. Ext.getCmp('lbbel4').hide();
  472. Ext.getCmp('empup_3').hide();
  473. Ext.getCmp('lbbel0').show();
  474. Ext.getCmp('sens_size').show();
  475. Ext.getCmp('empty0').show();
  476. Ext.getCmp('lbbel11').show();
  477. Ext.getCmp('lens_fl').show();
  478. Ext.getCmp('empty1').show();
  479. Ext.getCmp('lbbel1').show();
  480. Ext.getCmp('zoom_val').show();
  481. Ext.getCmp('zoom_d').show();
  482. break;
  483. };
  484. case 2:{
  485. Ext.getCmp('lbbel0').hide();
  486. Ext.getCmp('sens_size').hide();
  487. Ext.getCmp('empty0').hide();
  488. Ext.getCmp('lbbel11').hide();
  489. Ext.getCmp('lens_fl').hide();
  490. Ext.getCmp('empty1').hide();
  491. Ext.getCmp('lbbel1').hide();
  492. Ext.getCmp('zoom_val').hide();
  493. Ext.getCmp('zoom_d').hide();
  494. Ext.getCmp('lbbel2').show();
  495. Ext.getCmp('zoom_val2').show();
  496. Ext.getCmp('zoom_d2').show();
  497. Ext.getCmp('lbbel3').show();
  498. Ext.getCmp('zoom_range1').show();
  499. Ext.getCmp('empup_2').show();
  500. Ext.getCmp('zoom_perc1').show();
  501. Ext.getCmp('lbbel4').show();
  502. Ext.getCmp('empup_3').show();
  503. break;
  504. };
  505. };
  506. }
  507. }
  508. },{
  509. html: '&nbsp;'
  510. },{
  511. id: 'lbbel0',
  512. width: 200,
  513. hidden: ({$Cam['zoom_model']}==2),
  514. html: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}'
  515. },{
  516. xtype: 'combo',
  517. id: 'sens_size',
  518. hidden: ({$Cam['zoom_model']}==2),
  519. fieldLabel: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}',
  520. lazyRender: true,
  521. mode: 'local',
  522. forceSelection: true,
  523. triggerAction: 'all',
  524. editable: false,
  525. disableKeyFilter: true,
  526. store: new Ext.data.ArrayStore({
  527. fields: ['size','size_txt'],
  528. data: [
  529. [0,'1/3.6"'],
  530. [1,'1/3.2"'],
  531. [2,'1/3"'],
  532. [3,'1/2.7"'],
  533. [4,'1/2"'],
  534. [5,'1/1.8"'],
  535. [6,'2/3"'],
  536. [7,'1"'],
  537. [8,'4/3"'],
  538. [9,'APS-C'],
  539. [10,'35 mm'],
  540. [11,'645']
  541. ]
  542. }),
  543. valueField: 'size',
  544. displayField: 'size_txt',
  545. value: {$Cam['imager_type']},
  546. listeners:{
  547. select:function( c, r, i ){
  548. doCamOperation( {$CID}, 2, i );
  549. }
  550. }
  551. },{
  552. id: 'empty0',
  553. hidden: ({$Cam['zoom_model']}==2),
  554. html: '&nbsp;'
  555. },{
  556. id: 'lbbel11',
  557. hidden: ({$Cam['zoom_model']}==2),
  558. html: '{$Labels->GetLabel('_CAM_FOCALL_')}'
  559. },{
  560. xtype: 'combo',
  561. id: 'lens_fl',
  562. hidden: ({$Cam['zoom_model']}==2),
  563. fieldLabel: '{$Labels->GetLabel('_CAM_FOCALL_')}',
  564. lazyRender: true,
  565. mode: 'local',
  566. forceSelection: true,
  567. triggerAction: 'all',
  568. editable: false,
  569. disableKeyFilter: true,
  570. store: new Ext.data.ArrayStore({
  571. fields: ['fl','fl_txt'],
  572. data: [
  573. [0,'2.7 mm.'],
  574. [1,'3.0 mm.'],
  575. [2,'3.2 mm.'],
  576. [3,'3.5 mm.'],
  577. [4,'3.7 mm.'],
  578. [5,'3.9 mm.'],
  579. [6,'4.0 mm.'],
  580. [7,'4.3 mm.'],
  581. [8,'4.8 mm.'],
  582. [9,'5.0 mm.'],
  583. [10,'5.1 mm.'],
  584. [11,'5.5 mm.'],
  585. [12,'5.8 mm.'],
  586. [13,'6.0 mm.'],
  587. [14,'6.2 mm.'],
  588. [15,'6.6 mm.'],
  589. [16,'7.0 mm.'],
  590. [17,'7.1 mm.'],
  591. [18,'7.5 mm.'],
  592. [19,'7.6 mm.'],
  593. [20,'8.0 mm.'],
  594. [21,'8.6 mm.'],
  595. [22,'8.9 mm.'],
  596. [23,'9.0 mm.'],
  597. [24,'9.2 mm.'],
  598. [25,'9.3 mm.'],
  599. [26,'10.0 mm.'],
  600. [27,'10.5 mm.'],
  601. [28,'10.6 mm.'],
  602. [29,'10.7 mm.'],
  603. [30,'11.0 mm.'],
  604. [31,'11.3 mm.'],
  605. [32,'12.0 mm.'],
  606. [33,'12.9 mm.'],
  607. [34,'13.0 mm.'],
  608. [35,'13.5 mm.'],
  609. [36,'13.6 mm.'],
  610. [37,'14.0 mm.'],
  611. [38,'14.6 mm.'],
  612. [39,'15.0 mm.'],
  613. [40,'15.1 mm.'],
  614. [41,'15.5 mm.'],
  615. [42,'16.0 mm.'],
  616. [43,'17.0 mm.'],
  617. [44,'17.5 mm.'],
  618. [44,'17.7 mm.'],
  619. [45,'18.0 mm.'],
  620. [46,'18.2 mm.'],
  621. [47,'19.0 mm.']
  622. ]
  623. }),
  624. valueField: 'fl',
  625. displayField: 'fl_txt',
  626. value: {$Cam['lens_f']},
  627. listeners:{
  628. select:function( c, r, i ){
  629. doCamOperation( {$CID}, 3, i );
  630. }
  631. }
  632. },{
  633. id: 'empty1',
  634. hidden: ({$Cam['zoom_model']}==2),
  635. html: '&nbsp;'
  636. },{
  637. id: 'lbbel1',
  638. hidden: ({$Cam['zoom_model']}!=1),
  639. html: '{$Labels->GetLabel('_CAM_ZOOMR_')}'
  640. },{
  641. xtype: 'slider',
  642. id: 'zoom_val',
  643. hidden: ({$Cam['zoom_model']}!=1),
  644. disabled: ( parseFloat({$Cam['zoom']})==0 ),
  645. minValue: 1.0,
  646. maxValue: 140.0,
  647. value: {$Cam['zoom']},
  648. listeners:{
  649. change: function( a, c, b ){
  650. doCamOperation( {$CID}, 4, c );
  651. var zz = Ext.getCmp('zoom_d');
  652. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  653. }
  654. }
  655. },{
  656. id: 'zoom_d',
  657. hidden: ({$Cam['zoom_model']}!=1),
  658. html: (( parseFloat({$Cam['zoom']})==0 )?'&nbsp;':'<p>X&nbsp;'+ {$Cam['zoom']} + '</p>' )
  659. },{
  660. id: 'lbbel3',
  661. hidden: ({$Cam['zoom_model']}!=2),
  662. html: '{$Labels->GetLabel('_CAM_MAX_RANGE_')}'
  663. },{
  664. xtype: 'numberfield',
  665. id: 'zoom_range1',
  666. width: 240,
  667. hidden: ({$Cam['zoom_model']}!=2),
  668. value: {$Cam['max_range']},
  669. listeners:{
  670. change: function( a, c, b ){
  671. doCamOperation( {$CID}, 22, c );
  672. }
  673. }
  674. },{
  675. id: 'empup_2',
  676. hidden: ({$Cam['zoom_model']}!=2),
  677. html: '{$Labels->GetLabel('_METERS_')}'
  678. },{
  679. id: 'lbbel4',
  680. hidden: ({$Cam['zoom_model']}!=2),
  681. html: ''
  682. },{
  683. id: 'zoom_perc1',
  684. width: 240,
  685. hidden: ({$Cam['zoom_model']}!=2),
  686. html: '<center><p>'+ {$Cam['zoom']} + '%</p></center>'
  687. },{
  688. id: 'empup_3',
  689. hidden: ({$Cam['zoom_model']}!=2),
  690. html: ''
  691. },{
  692. id: 'lbbel2',
  693. hidden: ({$Cam['zoom_model']}!=2),
  694. style: {
  695. marginLeft: '120px' //https://www.biostar.com.tw/app/en/eol/introduction.php?S_ID=711
  696. },
  697. html: '<img width="32px" src="/style/wicons/wide.png"/>'
  698. },{
  699. xtype: 'slider',
  700. id: 'zoom_val2',
  701. hidden: ({$Cam['zoom_model']}!=2),
  702. minValue: 1.0,
  703. maxValue: 100.0,
  704. value: {$Cam['zoom']},
  705. listeners:{
  706. change: function( a, c, b ){
  707. doCamOperation( {$CID}, 23, c );
  708. var zz = Ext.getCmp('zoom_perc1');
  709. if( zz.rendered ) zz.update('<center><p>'+ c + '%</p></center>');
  710. }
  711. }
  712. },{
  713. id: 'zoom_d2',
  714. hidden: ({$Cam['zoom_model']}!=2),
  715. html: '<img width="32px" src="/style/wicons/narrow.png"/>'
  716. }]
  717. }]
  718. },{
  719. title: '{$Labels->GetLabel('_PTZ_TAB_')}',
  720. id: 'ptz_tab',
  721. frame: false,
  722. border: false,
  723. items:[{
  724. layout: 'table',
  725. frame: false,
  726. border: false,
  727. layoutConfig: {
  728. columns: 3
  729. },
  730. defaults: {
  731. frame: false,
  732. bodyStyle: 'padding:10px',
  733. border: false
  734. },
  735. items:[{
  736. width: 200,
  737. html: '{$Labels->GetLabel('__PTZ_CONTROL__')}'
  738. },{
  739. xtype: 'combo',
  740. fieldLabel: '{$Labels->GetLabel('__PTZ_CONTROL__')}',
  741. lazyRender: true,
  742. id: 'ptz_proto',
  743. mode: 'local',
  744. forceSelection: true,
  745. triggerAction: 'all',
  746. editable: false,
  747. disableKeyFilter: true,
  748. store: new Ext.data.ArrayStore({
  749. fields: ['type','type_txt'],
  750. data: [
  751. [0,'{$Labels->GetLabel('_NO_PTZ_')}'],
  752. [1,'Sony VISCA'],
  753. [2,'Pelco-D'],
  754. [3,'OnVif'],
  755. [4,'PSIA'],
  756. [5,'GB/T28181']
  757. ]
  758. }),
  759. value: {$Cam['protocol']},
  760. valueField: 'type',
  761. displayField: 'type_txt',
  762. listeners:{
  763. select: function( a, c, b ){
  764. doCamOperation( {$CID}, 5, b );
  765. if( b > 0 ){
  766. Ext.getCmp('cam_drive_par').show();
  767. if(({$Cam['type']}==13)||({$Cam['type']}==11)){
  768. Ext.getCmp('cam_ptz_par').show();
  769. } else {
  770. Ext.getCmp('cam_ptz_par').hide();
  771. };
  772. if( b == 1 || b == 2 ){
  773. Ext.getCmp('cam_uart_par').show();
  774. Ext.getCmp('uart_id').enable();
  775. Ext.getCmp('prot_id').enable();
  776. } else {
  777. Ext.getCmp('cam_uart_par').hide();
  778. Ext.getCmp('uart_id').disable();
  779. Ext.getCmp('prot_id').disable();
  780. };
  781. Ext.getCmp('pan_mode').enable();
  782. Ext.getCmp('tilt_mode').enable();
  783. Ext.getCmp('pan_ang').enable();
  784. Ext.getCmp('tilt_ang').enable();
  785. } else {
  786. Ext.getCmp('cam_ptz_par').hide();
  787. Ext.getCmp('cam_drive_par').hide();
  788. Ext.getCmp('cam_uart_par').hide();
  789. Ext.getCmp('uart_id').disable();
  790. Ext.getCmp('prot_id').disable();
  791. Ext.getCmp('pan_mode').disable();
  792. Ext.getCmp('tilt_mode').disable();
  793. Ext.getCmp('pan_ang').disable();
  794. Ext.getCmp('tilt_ang').disable();
  795. };
  796. }
  797. }
  798. },{
  799. html: '&nbsp;'
  800. }]
  801. },{
  802. layout: 'table',
  803. id: 'cam_uart_par',
  804. frame: false,
  805. border: false,
  806. hidden: (({$Cam['protocol']}!=1) || ({$Cam['protocol']}!=2)),
  807. layoutConfig: {
  808. columns: 3
  809. },
  810. defaults: {
  811. frame: false,
  812. bodyStyle: 'padding:10px',
  813. border: false
  814. },
  815. items:[{
  816. width: 200,
  817. html: '{$Labels->GetLabel('_UART_PORT_')}'
  818. },{
  819. xtype: 'combo',
  820. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  821. lazyRender: true,
  822. id: 'uart_id',
  823. mode: 'local',
  824. forceSelection: true,
  825. triggerAction: 'all',
  826. editable: false,
  827. disableKeyFilter: true,
  828. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  829. store: new Ext.data.ArrayStore({
  830. fields: ['uart','uart_txt'],
  831. data: [{$UARTS}]
  832. }),
  833. valueField: 'uart',
  834. displayField: 'uart_txt',
  835. value: {$Cam['uart_id']},
  836. listeners:{
  837. select: function( a, c, b ){
  838. doCamOperation( {$CID}, 6, b );
  839. }
  840. }
  841. },{
  842. html: '&nbsp;'
  843. },{
  844. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  845. },{
  846. xtype: 'numberfield',
  847. id: 'prot_id',
  848. width: '95%',
  849. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  850. minValue: 0,
  851. maxValue: 255,
  852. value: {$Cam['protocol_aux']},
  853. listeners:{
  854. change: function( a, c, b ){
  855. doCamOperation( {$CID}, 7, c );
  856. }
  857. }
  858. },{
  859. html: '&nbsp;'
  860. }]
  861. },{
  862. layout: 'table',
  863. id: 'cam_drive_par',
  864. frame: false,
  865. border: false,
  866. hidden: ({$Cam['protocol']}<1),
  867. layoutConfig: {
  868. columns: 3
  869. },
  870. defaults: {
  871. frame: false,
  872. bodyStyle: 'padding:10px',
  873. border: false
  874. },
  875. items:[{
  876. width: 200,
  877. html: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}'
  878. },{
  879. xtype: 'combo',
  880. fieldLabel: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}',
  881. lazyRender: true,
  882. id: 'cam_ptz_mode',
  883. mode: 'local',
  884. forceSelection: true,
  885. triggerAction: 'all',
  886. editable: false,
  887. disableKeyFilter: true,
  888. store: new Ext.data.ArrayStore({
  889. fields: ['momo','momo_txt'],
  890. data: [[0,'Absolute'],[1,'Presetets']]
  891. }),
  892. valueField: 'momo',
  893. displayField: 'momo_txt',
  894. value: ((({$Cam['type']}==13)||({$Cam['type']}==11))?0:1),
  895. listeners:{
  896. select: function( a, c, b ){
  897. doCamOperation( {$CID}, 27, b );
  898. if( b == 1 ){
  899. Ext.getCmp('cam_ed_preset').enable();
  900. Ext.getCmp('cam_ptz_par').hide();
  901. } else {
  902. Ext.getCmp('cam_ed_preset').disable();
  903. Ext.getCmp('cam_ptz_par').show();
  904. };
  905. }
  906. }
  907. },{
  908. xtype: 'button',
  909. id: 'cam_ed_preset',
  910. //disabled: (({$Cam['type']}==13)||({$Cam['type']}==11)),
  911. text: '{$Labels->GetLabel('_CAM_PRES_EDIT_')}',
  912. handler: function(){
  913. var zaza = new Ext.Window({
  914. title: '{$Labels->GetLabel('_CAM_PRES_EDITOR_')}',
  915. modal: true,
  916. resizable: false,
  917. width: 800,
  918. height: 804,
  919. sukaMineWidth: -1,
  920. items:[{
  921. id: 'db_node_{$Node['id']}_pic',
  922. border: true,
  923. width: '100%',
  924. html: '<div id="img-1" style="display: flex;align-items: center;" ><img id="img-img-1" src="/video_feed/stream?id={$Cam['stream_id']}" width="100%" /><div style="float: left; position: absolute; left: 30px; bottom: 50px; z-index: 1000;"><table width="100%" border=0><tr><td width="24"><img id="img_btn_010_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/010.png"></td><td width="24"><img id="img_btn_032_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/032.png"></td><td width="24"><img id="img_btn_033_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/033.png"></td><td width="24"><img id="img_btn_034_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/034.png"></td><td width="24"><img id="img_btn_035_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/ir_off.png"></td></tr><tr><td><img id="img_btn_011_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/011.png"></td><td><img id="img_btn_031_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/031.png"></td><td><img id="img_btn_020_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/basic/020.png"></td><td><img id="img_btn_027_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/027.png"></td><td width="24"><img id="img_btn_036_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/ir_on.png"></td></tr><tr><td></td><td><img id="img_btn_030_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/030.png"></td><td><img id="img_btn_029_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/029.png"></td><td><img id="img_btn_028_{$Node['id']}" class="ptz_ctrl_btn" src="/style/png/player/028.png"></td><td width="24"><img id="img_btn_037_{$CID}" class="ptz_ctrl_btn_hdn" src="/style/png/player/washer.png"></td></tr></table></div><div style="float: right; position: absolute; right: 0px; top: 0px; z-index: 1000;"><svg width="450px" height="450px" id="ptz_presets_0" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd;"></svg></div></div>'
  925. },{
  926. layout: 'table',
  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_PRES_SSELECT_')}'
  938. },{
  939. xtype: 'combo',
  940. lazyRender: true,
  941. id: 'sensor_id',
  942. mode: 'local',
  943. forceSelection: true,
  944. triggerAction: 'all',
  945. editable: false,
  946. disableKeyFilter: true,
  947. //disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  948. store: new Ext.data.ArrayStore({
  949. fields: ['sens','sens_txt'],
  950. data: {$SENSORS}
  951. }),
  952. valueField: 'sens',
  953. displayField: 'sens_txt',
  954. value: {$SENSOID},
  955. listeners:{
  956. select: function( a, c, b ){
  957. selectedPresetsBackgroundSensor = c.data.sens;
  958. }
  959. }
  960. },{
  961. xtype: 'button',
  962. text: '{$Labels->GetLabel('_CAM_PRES_LOBACK_')}',
  963. width: 240,
  964. handler: function(){
  965. if( selectedPresetsBackgroundSensor == 0 ){
  966. selectedPresetsBackgroundSensor = Ext.getCmp( 'sensor_id' ).getValue();
  967. //selectedPresetsBackgroundSensor = {$SENSOID};
  968. };
  969. if( selectedPresetsBackgroundSensor ) preview2DDraw( selectedPresetsBackgroundSensor, 'ptz_presets_');
  970. }
  971. },{
  972. html: ''
  973. },{
  974. xtype: 'button',
  975. text: '{$Labels->GetLabel('_CAM_PRES_DELALL_')}',
  976. width: 230,
  977. handler: function(){
  978. doCamOperation( {$CID}, 34, 0 );
  979. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 1000 );
  980. }
  981. },{
  982. xtype: 'button',
  983. text: '{$Labels->GetLabel('_CAM_PRES_REMBG_')}',
  984. width: 240,
  985. handler: function(){
  986. selectedPresetsBackgroundSensor = 0;
  987. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  988. }
  989. },{
  990. html: '{$Labels->GetLabel('_CAM_PRES_COUNT_')}'
  991. },{
  992. xtype: 'numberfield',
  993. id: 'pres_count',
  994. width: 240
  995. },{
  996. xtype: 'button',
  997. text: 'Set',
  998. width: 240,
  999. handler: function(){
  1000. var vv = Ext.getCmp('pres_count').getValue();
  1001. if( vv ){
  1002. doCamOperation( {$CID}, 31, vv );
  1003. };
  1004. }
  1005. },{
  1006. html: '{$Labels->GetLabel('_CAM_PRES_COLS_')}'
  1007. },{
  1008. xtype: 'numberfield',
  1009. id: 'pres_p_seg',
  1010. width: 240
  1011. },{
  1012. xtype: 'button',
  1013. text: '{$Labels->GetLabel('__SET__')}',
  1014. width: 240,
  1015. handler: function(){
  1016. var vv = Ext.getCmp('pres_p_seg').getValue();
  1017. if( vv ){
  1018. doCamOperation( {$CID}, 32, vv );
  1019. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1020. };
  1021. }
  1022. },{
  1023. html: '{$Labels->GetLabel('_CAM_PRES_ROWS_')}'
  1024. },{
  1025. xtype: 'numberfield',
  1026. id: 'pres_z_seg',
  1027. width: 240
  1028. },{
  1029. xtype: 'button',
  1030. text: '{$Labels->GetLabel('__SET__')}',
  1031. width: 240,
  1032. handler: function(){
  1033. var vv = Ext.getCmp('pres_z_seg').getValue();
  1034. if( vv ){
  1035. doCamOperation( {$CID}, 33, vv );
  1036. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1037. };
  1038. }
  1039. },{
  1040. html: '{$Labels->GetLabel('_CAM_PRES_IROFF_')}'
  1041. },{
  1042. xtype: 'numberfield',
  1043. id: 'pres_iroff',
  1044. width: 240
  1045. },{
  1046. xtype: 'button',
  1047. text: '{$Labels->GetLabel('__SET__')}',
  1048. width: 240,
  1049. handler: function(){
  1050. var vv = Ext.getCmp('pres_iroff').getValue();
  1051. doCamOperation( {$CID}, 35, vv );
  1052. }
  1053. },{
  1054. html: '{$Labels->GetLabel('_CAM_PRES_IRON_')}'
  1055. },{
  1056. xtype: 'numberfield',
  1057. id: 'pres_iron',
  1058. width: 240
  1059. },{
  1060. xtype: 'button',
  1061. text: '{$Labels->GetLabel('__SET__')}',
  1062. width: 240,
  1063. handler: function(){
  1064. var vv = Ext.getCmp('pres_iron').getValue();
  1065. doCamOperation( {$CID}, 36, vv );
  1066. }
  1067. },{
  1068. html: '{$Labels->GetLabel('_CAM_PRES_IRAUTO_')}'
  1069. },{
  1070. xtype: 'numberfield',
  1071. id: 'pres_irauto',
  1072. width: 240
  1073. },{
  1074. xtype: 'button',
  1075. text: '{$Labels->GetLabel('__SET__')}',
  1076. width: 240,
  1077. handler: function(){
  1078. var vv = Ext.getCmp('pres_irauto').getValue();
  1079. doCamOperation( {$CID}, 37, vv );
  1080. }
  1081. },{
  1082. html: '{$Labels->GetLabel('_CAM_PRES_IRWIPER_')}'
  1083. },{
  1084. xtype: 'numberfield',
  1085. id: 'pres_wiper',
  1086. width: 240
  1087. },{
  1088. xtype: 'button',
  1089. text: '{$Labels->GetLabel('__SET__')}',
  1090. width: 240,
  1091. handler: function(){
  1092. var vv = Ext.getCmp('pres_wiper').getValue();
  1093. doCamOperation( {$CID}, 38, vv );
  1094. }
  1095. }]
  1096. }],
  1097. listeners:{
  1098. resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
  1099. if( rawWidth!= undefined ){
  1100. if( p.sukaMineWidth != adjWidth ){
  1101. p.sukaMineWidth = adjWidth;
  1102. var XX = p.sukaMineWidth * 9 / 16;
  1103. //p.setHeight( XX + 32 );
  1104. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1105. z.setHeight( XX );
  1106. };
  1107. };
  1108. },
  1109. afterrender: function( p ){
  1110. var xx = p.getWidth() * 9 / 16;
  1111. //p.setHeight( xx + 32 );
  1112. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1113. z.setHeight( xx );
  1114. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1115. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1116. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1117. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1118. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1119. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1120. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1121. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1122. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1123. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1124. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1125. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1126. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1127. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1128. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1129. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1130. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1131. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1132. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1133. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1134. document.getElementById('img_btn_020_{$Node['id']}').addEventListener( 'mousedown', makePtzStop );
  1135. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1136. }
  1137. }
  1138. });
  1139. zaza.show();
  1140. }
  1141. },{
  1142. html: '{$Labels->GetLabel('_CAM_IR_ECO_')}'
  1143. },{
  1144. xtype: 'checkbox',
  1145. id: 'ptz_ir_eco',
  1146. checked: ({$Cam['eco_ir']} > 0 ),
  1147. listeners:{
  1148. check: function( a, c ){
  1149. if( c ){
  1150. doCamOperation( {$CID}, 39, 1 );
  1151. } else {
  1152. doCamOperation( {$CID}, 39, 0 );
  1153. };
  1154. }
  1155. }
  1156. },{
  1157. html: '&nbsp;'
  1158. },{
  1159. html: '{$Labels->GetLabel('_CAM_PTZ_AAC_')}'
  1160. },{
  1161. xtype: 'checkbox',
  1162. id: 'ptz_axel_c',
  1163. disabled: ({$Cam['protocol']} == 0),
  1164. checked: ({$Cam['ptz_axel']} < 6 ),
  1165. listeners:{
  1166. check: function( a, c ){
  1167. if( c ){
  1168. doCamOperation( {$CID}, 13, 0 );
  1169. var zz = Ext.getCmp('ptz_axel');
  1170. zz.disable();
  1171. } else {
  1172. var zz = Ext.getCmp('ptz_axel');
  1173. zz.enable();
  1174. var vava = zz.getValue();
  1175. if( vava < 5 ){
  1176. vava = 5;
  1177. zz.setValue( vava, true );
  1178. } else {
  1179. doCamOperation( {$CID}, 13, vava );
  1180. };
  1181. var jj = Ext.getCmp('ptz_axel_d');
  1182. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  1183. };
  1184. }
  1185. }
  1186. },{
  1187. html: '&nbsp;'
  1188. },{
  1189. html: '{$Labels->GetLabel('_CAM_PTZ_MAC_')}'
  1190. },{
  1191. xtype: 'slider',
  1192. id: 'ptz_axel',
  1193. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 6)),
  1194. minValue: 5,
  1195. maxValue: 20,
  1196. value: {$Cam['ptz_axel']},
  1197. listeners:{
  1198. change: function( a, c, b ){
  1199. doCamOperation( {$CID}, 13, c );
  1200. var zz = Ext.getCmp('ptz_axel_d');
  1201. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  1202. }
  1203. }
  1204. },{
  1205. id: 'ptz_axel_d',
  1206. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  1207. }]
  1208. },{
  1209. layout: 'table',
  1210. id: 'cam_ptz_par',
  1211. hidden: (({$Cam['protocol']}<1) || ({$Cam['type']}>13)),
  1212. frame: false,
  1213. border: false,
  1214. layoutConfig: {
  1215. columns: 3
  1216. },
  1217. defaults: {
  1218. frame: false,
  1219. bodyStyle: 'padding:10px',
  1220. border: false
  1221. },
  1222. items:[{
  1223. width: 200,
  1224. html: '{$Labels->GetLabel('_CAM_PANMOD_')}'
  1225. },{
  1226. xtype: 'combo',
  1227. fieldLabel: '{$Labels->GetLabel('_CAM_PANMOD_')}',
  1228. lazyRender: true,
  1229. id: 'pan_mode',
  1230. disabled: ({$Cam['protocol']} == 0),
  1231. mode: 'local',
  1232. forceSelection: true,
  1233. triggerAction: 'all',
  1234. editable: false,
  1235. disableKeyFilter: true,
  1236. store: new Ext.data.ArrayStore({
  1237. fields: ['pm','pm_txt'],
  1238. data: [
  1239. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1240. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}']
  1241. ]
  1242. }),
  1243. valueField: 'pm',
  1244. displayField: 'pm_txt',
  1245. value: {$Cam['pan_model']},
  1246. listeners:{
  1247. select: function( a, c, b ){
  1248. doCamOperation( {$CID}, 8, b );
  1249. }
  1250. }
  1251. },{
  1252. html: '&nbsp;'
  1253. },{
  1254. html: '{$Labels->GetLabel('_CAM_PANANGS_')}'
  1255. },{
  1256. xtype: 'numberfield',
  1257. id: 'pan_ang',
  1258. width: '95%',
  1259. disabled: ({$Cam['protocol']} == 0),
  1260. minValue: 0,
  1261. maxValue: 360,
  1262. value: {$Cam['pan_angles']},
  1263. listeners:{
  1264. change: function( a, c, b ){
  1265. doCamOperation( {$CID}, 9, c );
  1266. }
  1267. }
  1268. },{
  1269. html: '&nbsp;'
  1270. },{
  1271. html: '{$Labels->GetLabel('_CAM_TILTMOD_')}'
  1272. },{
  1273. xtype: 'combo',
  1274. fieldLabel: '{$Labels->GetLabel('_CAM_TILTMOD_')}',
  1275. lazyRender: true,
  1276. id: 'tilt_mode',
  1277. disabled: ({$Cam['protocol']} == 0),
  1278. mode: 'local',
  1279. forceSelection: true,
  1280. triggerAction: 'all',
  1281. editable: false,
  1282. disableKeyFilter: true,
  1283. store: new Ext.data.ArrayStore({
  1284. fields: ['tm','tm_txt'],
  1285. data: [
  1286. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1287. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}'],
  1288. [2,'{$Labels->GetLabel('_CAM_TM_SHIFTED_')} 90�'],
  1289. [3,'{$Labels->GetLabel('_CAM_TM_RSHIFTED_')} 90�']
  1290. ]
  1291. }),
  1292. valueField: 'tm',
  1293. displayField: 'tm_txt',
  1294. value: {$Cam['tilt_model']},
  1295. listeners:{
  1296. select: function( a, c, b ){
  1297. doCamOperation( {$CID}, 10, b );
  1298. }
  1299. }
  1300. },{
  1301. html: '&nbsp;'
  1302. },{
  1303. html: '{$Labels->GetLabel('_CAM_TILTANGS_')}'
  1304. },{
  1305. xtype: 'numberfield',
  1306. id: 'tilt_ang',
  1307. width: '95%',
  1308. disabled: ({$Cam['protocol']} == 0),
  1309. minValue: 0,
  1310. maxValue: 180,
  1311. value: {$Cam['tilt_angles']},
  1312. listeners:{
  1313. change: function( a, c, b ){
  1314. doCamOperation( {$CID}, 11, c );
  1315. }
  1316. }
  1317. },{
  1318. html: '&nbsp;'
  1319. }]
  1320. },{
  1321. layout: 'table',
  1322. id: 'cam_loc_ori',
  1323. frame: false,
  1324. border: false,
  1325. layoutConfig: {
  1326. columns: 3
  1327. },
  1328. defaults: {
  1329. frame: false,
  1330. bodyStyle: 'padding:10px',
  1331. border: false
  1332. },
  1333. items:[{
  1334. width: 200,
  1335. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  1336. },{
  1337. xtype: 'numberfield',
  1338. decimalPrecision: 3,
  1339. value: {$Cam['x_rot']},
  1340. listeners:{
  1341. change: function( a, c, b ){
  1342. doCamOperation( {$CID}, 14, c );
  1343. }
  1344. }
  1345. },{
  1346. html: '&nbsp;'
  1347. },{
  1348. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  1349. },{
  1350. xtype: 'numberfield',
  1351. decimalPrecision: 3,
  1352. value: {$Cam['y_rot']},
  1353. listeners:{
  1354. change: function( a, c, b ){
  1355. doCamOperation( {$CID}, 15, c );
  1356. }
  1357. }
  1358. },{
  1359. html: '&nbsp;'
  1360. },{
  1361. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  1362. },{
  1363. xtype: 'numberfield',
  1364. decimalPrecision: 3,
  1365. value: {$Cam['z_rot']},
  1366. listeners:{
  1367. change: function( a, c, b ){
  1368. doCamOperation( {$CID}, 16, c );
  1369. }
  1370. }
  1371. },{
  1372. html: '&nbsp;'
  1373. },{
  1374. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  1375. },{
  1376. xtype: 'numberfield',
  1377. decimalPrecision: 3,
  1378. value: {$Cam['x']},
  1379. listeners:{
  1380. change: function( a, c, b ){
  1381. doCamOperation( {$CID}, 17, c );
  1382. }
  1383. }
  1384. },{
  1385. html: '&nbsp;'
  1386. },{
  1387. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  1388. },{
  1389. xtype: 'numberfield',
  1390. decimalPrecision: 3,
  1391. value: {$Cam['y']},
  1392. listeners:{
  1393. change: function( a, c, b ){
  1394. doCamOperation( {$CID}, 18, c );
  1395. }
  1396. }
  1397. },{
  1398. html: '&nbsp;'
  1399. },{
  1400. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
  1401. },{
  1402. xtype: 'numberfield',
  1403. decimalPrecision: 3,
  1404. value: {$Cam['z']},
  1405. listeners:{
  1406. change: function( a, c, b ){
  1407. doCamOperation( {$CID}, 19, c );
  1408. }
  1409. }
  1410. },{
  1411. html: '&nbsp;'
  1412. }]
  1413. }]
  1414. },{
  1415. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  1416. id: 'target_tab',
  1417. frame: false,
  1418. border: false,
  1419. items:[{
  1420. layout: 'table',
  1421. frame: false,
  1422. border: false,
  1423. layoutConfig: {
  1424. columns: 3
  1425. },
  1426. defaults: {
  1427. frame: false,
  1428. bodyStyle: 'padding:10px',
  1429. border: false
  1430. },
  1431. items:[{
  1432. width: 200,
  1433. html: '{$Labels->GetLabel('_CAM_LABEL_')}'
  1434. },{
  1435. xtype: 'textfield',
  1436. id: 'cam_label',
  1437. width: 200,
  1438. value: '{$Cam['node_name']}',
  1439. listeners:{
  1440. change: function( a, c, b ){
  1441. doCamOperation( {$CID}, 20, c );
  1442. }
  1443. }
  1444. },{
  1445. xtype: 'spacer'
  1446. },{
  1447. width: 200,
  1448. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  1449. },{
  1450. xtype: 'combo',
  1451. lazyRender: true,
  1452. id: 'cam_targeting',
  1453. mode: 'local',
  1454. forceSelection: true,
  1455. triggerAction: 'all',
  1456. editable: false,
  1457. disableKeyFilter: true,
  1458. store: new Ext.data.ArrayStore({
  1459. fields: ['type','type_txt'],
  1460. data: [
  1461. [0,'{$Labels->GetLabel('_CAM_TM_STRICT_VISIBLE_')}'],
  1462. [1,'{$Labels->GetLabel('_CAM_TM_ALL_NEAR_')}'],
  1463. [2,'{$Labels->GetLabel('_CAM_TM_ALL_FAR_')}'],
  1464. [3,'{$Labels->GetLabel('_CAM_TM_ALL_')}']
  1465. ]
  1466. }),
  1467. value: {$Cam['trigger_mode']},
  1468. valueField: 'type',
  1469. displayField: 'type_txt',
  1470. listeners:{
  1471. select: function( a, c, b ){
  1472. doCamOperation( {$CID}, 12, b );
  1473. }
  1474. }
  1475. },{
  1476. xtype: 'spacer'
  1477. },{
  1478. width: 200,
  1479. html: '{$Labels->GetLabel('_CAM_PREF_ONLY_')}'
  1480. },{
  1481. xtype: 'checkbox',
  1482. id: 'cam_pref_only',
  1483. fieldLabel: '',
  1484. width: 200,
  1485. checked: {$Cam['prefered_events_only']},
  1486. listeners:{
  1487. check: function( a, c ){
  1488. if( c ){
  1489. doCamOperation( {$CID}, 40, 1 );
  1490. } else {
  1491. doCamOperation( {$CID}, 40, 0 );
  1492. };
  1493. }
  1494. }
  1495. },{
  1496. xtype: 'spacer'
  1497. },{
  1498. width: 200,
  1499. html: '{$Labels->GetLabel('_CAM_AUTO_HOMING_')}'
  1500. },{
  1501. xtype: 'checkbox',
  1502. id: 'cam_horeten',
  1503. fieldLabel: '',
  1504. width: 200,
  1505. checked: {$Cam['homing_enable']},
  1506. listeners:{
  1507. check: function( a, c ){
  1508. if( c ){
  1509. doCamOperation( {$CID}, 25, 1 );
  1510. } else {
  1511. doCamOperation( {$CID}, 25, 0 );
  1512. };
  1513. }
  1514. }
  1515. },{
  1516. xtype: 'spacer'
  1517. },{
  1518. width: 200,
  1519. html: '{$Labels->GetLabel('_CAM_AH_TIME_')}'
  1520. },{
  1521. xtype: 'numberfield',
  1522. id: 'cam_horetto',
  1523. width: 200,
  1524. value: '{$Cam['homing_to']}',
  1525. listeners:{
  1526. change: function( a, c, b ){
  1527. doCamOperation( {$CID}, 26, c );
  1528. }
  1529. }
  1530. },{
  1531. xtype: 'spacer'
  1532. },{
  1533. width: 200,
  1534. html: '{$Labels->GetLabel('_CAM_AH_TOKEN_')}'
  1535. },{
  1536. xtype: 'textfield',
  1537. id: 'cam_horettk',
  1538. fieldLabel: '',
  1539. width: 200,
  1540. value: '{$Cam['home_token']}',
  1541. readOnly: true
  1542. },{
  1543. xtype: 'spacer'
  1544. }]
  1545. }]
  1546. }]
  1547. }
  1548. PZAKSJEJSDKGJHGASD;
  1549. $Data['status']='ok';
  1550. if( $Cam['status'] == 0 ){
  1551. $ADDCAMPOPO = '';
  1552. } else {
  1553. $ADDCAMPOPO = '';
  1554. };
  1555. if( $CAM_IP ){
  1556. switch( $Cam['status'] ){
  1557. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  1558. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  1559. };
  1560. } else {
  1561. $Data['content'] = $TPL_CAM_EDITOR;
  1562. };
  1563. } else {
  1564. $Data['status']='error';
  1565. };
  1566. echo $Data['content'];
  1567. } else {
  1568. header('location: /');
  1569. };
  1570. ?>