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.

1710 lines
49 KiB

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