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.

1684 lines
48 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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('_CAC_TAB_')}',
  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: 'checkbox',
  428. id: 'cam_manassign',
  429. fieldLabel: '{$Labels->GetLabel('_STATIC_CONNECTION_')}',
  430. width: 200,
  431. checked: {$Cam['manual']},
  432. listeners:{
  433. check: function( a, c ){
  434. if( c ){
  435. doCamOperation( {$CID}, 24, 1 );
  436. } else {
  437. doCamOperation( {$CID}, 24, 0 );
  438. };
  439. }
  440. }
  441. }]
  442. }{$RESET_CREDENTIALS}]
  443. },{
  444. title: '{$Labels->GetLabel('_STREAMS_')}',
  445. id: 'str_tab',
  446. frame: false,
  447. border: false,
  448. items:[{
  449. xtype: 'grid',
  450. height: 124,
  451. id: 'nd_cam_grid',
  452. frame: false,
  453. ds: new Ext.data.ArrayStore({
  454. fields: ['id','name','size','encode','bitrate'],
  455. data: [{$STREAMS}]
  456. }),
  457. cm: new Ext.grid.ColumnModel({
  458. columns: [
  459. {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
  460. {header: "Name", dataIndex: 'name' },
  461. {header: "Encoding",width: 120, sortable: false, fixed: true, menuDisabled: true, dataIndex: 'encode' },
  462. {header: "Frame", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  463. {header: "Bitrate", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'bitrate' }
  464. ],
  465. defaults: {
  466. sortable: false,
  467. menuDisabled: true,
  468. width: 100
  469. }
  470. }),
  471. sm: new Ext.grid.RowSelectionModel({
  472. singleSelect: true,
  473. listeners: {
  474. rowselect: function(sm, row, rec) {
  475. SelectedSource = rec.data.id;
  476. doCamOperation( {$CID}, 1, SelectedSource );
  477. var tt = Ext.getCmp('pic_prev');
  478. if( tt!= undefined ){
  479. //tt.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  480. tt.update( '<center><img width="100%" ondblclick="fullScreen(\'img-{$CID}\');" style="cursor: zoom-in" id="img-{$CID}" src="{$FU}'+SelectedSource+'"></center>' );
  481. };
  482. }
  483. }
  484. }),
  485. listeners:{
  486. viewready: function( t ){
  487. var tt = t.getSelectionModel();
  488. tt.selectRow({$SELECTED_STREAM});
  489. }
  490. }
  491. },{
  492. height: PanelH,
  493. id: 'pic_prev',
  494. html: '<center><img width="100%" src="/style/img/cam_cap0.png"></center>',
  495. listeners:{
  496. afterrender: function( t ){
  497. if( SelectedSource ){
  498. //t.update( '<center><img width="100%" src="/lib/controller/getCameraPreview.php?UID={$CUser->Data['id']}&SID={$Session}&FID='+SelectedSource+'"></center>' );
  499. };
  500. }
  501. }
  502. }],
  503. },{
  504. title: '{$Labels->GetLabel('_CAM_LENS_SETTINGS_')}',
  505. id: 'lens_tab',
  506. frame: false,
  507. border: false,
  508. items:[{
  509. layout: 'table',
  510. frame: false,
  511. border: false,
  512. layoutConfig: {
  513. columns: 3
  514. },
  515. defaults: {
  516. frame: false,
  517. bodyStyle: 'padding:10px',
  518. border: false
  519. },
  520. items:[{
  521. html: '{$Labels->GetLabel('_CAM_ZOOMMO_')}'
  522. },{
  523. xtype: 'combo',
  524. fieldLabel: '{$Labels->GetLabel('_CAM_ZOOMMO_')}',
  525. lazyRender: true,
  526. id: 'zoom_mo',
  527. mode: 'local',
  528. forceSelection: true,
  529. triggerAction: 'all',
  530. editable: false,
  531. disableKeyFilter: true,
  532. store: new Ext.data.ArrayStore({
  533. fields: ['zm','zm_txt'],
  534. data: [
  535. [0,'{$Labels->GetLabel('_CAM_FIXEDZ_')}'],
  536. [1,'{$Labels->GetLabel('_CAM_CUSTOMZ_')}'],
  537. [2,'{$Labels->GetLabel('_CAM_VARIOZ_')}']
  538. ]
  539. }),
  540. valueField: 'zm',
  541. displayField: 'zm_txt',
  542. value: {$Cam['zoom_model']},
  543. listeners:{
  544. select:function( c, r, i ){
  545. doCamOperation( {$CID}, 21, i );
  546. switch( i ){
  547. case 0:{
  548. Ext.getCmp('lbbel0').show();
  549. Ext.getCmp('sens_size').show();
  550. Ext.getCmp('empty0').show();
  551. Ext.getCmp('lbbel11').show();
  552. Ext.getCmp('lens_fl').show();
  553. Ext.getCmp('empty1').show();
  554. Ext.getCmp('lbbel1').hide();
  555. Ext.getCmp('zoom_val').hide();
  556. Ext.getCmp('zoom_d').hide();
  557. Ext.getCmp('lbbel2').hide();
  558. Ext.getCmp('zoom_val2').hide();
  559. Ext.getCmp('zoom_d2').hide();
  560. Ext.getCmp('lbbel3').hide();
  561. Ext.getCmp('zoom_range1').hide();
  562. Ext.getCmp('empup_2').hide();
  563. Ext.getCmp('zoom_perc1').hide();
  564. Ext.getCmp('lbbel4').hide();
  565. Ext.getCmp('empup_3').hide();
  566. break;
  567. };
  568. case 1:{
  569. Ext.getCmp('lbbel2').hide();
  570. Ext.getCmp('zoom_val2').hide();
  571. Ext.getCmp('zoom_d2').hide();
  572. Ext.getCmp('lbbel3').hide();
  573. Ext.getCmp('zoom_range1').hide();
  574. Ext.getCmp('empup_2').hide();
  575. Ext.getCmp('zoom_perc1').hide();
  576. Ext.getCmp('lbbel4').hide();
  577. Ext.getCmp('empup_3').hide();
  578. Ext.getCmp('lbbel0').show();
  579. Ext.getCmp('sens_size').show();
  580. Ext.getCmp('empty0').show();
  581. Ext.getCmp('lbbel11').show();
  582. Ext.getCmp('lens_fl').show();
  583. Ext.getCmp('empty1').show();
  584. Ext.getCmp('lbbel1').show();
  585. Ext.getCmp('zoom_val').show();
  586. Ext.getCmp('zoom_d').show();
  587. break;
  588. };
  589. case 2:{
  590. Ext.getCmp('lbbel0').hide();
  591. Ext.getCmp('sens_size').hide();
  592. Ext.getCmp('empty0').hide();
  593. Ext.getCmp('lbbel11').hide();
  594. Ext.getCmp('lens_fl').hide();
  595. Ext.getCmp('empty1').hide();
  596. Ext.getCmp('lbbel1').hide();
  597. Ext.getCmp('zoom_val').hide();
  598. Ext.getCmp('zoom_d').hide();
  599. Ext.getCmp('lbbel2').show();
  600. Ext.getCmp('zoom_val2').show();
  601. Ext.getCmp('zoom_d2').show();
  602. Ext.getCmp('lbbel3').show();
  603. Ext.getCmp('zoom_range1').show();
  604. Ext.getCmp('empup_2').show();
  605. Ext.getCmp('zoom_perc1').show();
  606. Ext.getCmp('lbbel4').show();
  607. Ext.getCmp('empup_3').show();
  608. break;
  609. };
  610. };
  611. }
  612. }
  613. },{
  614. html: '&nbsp;'
  615. },{
  616. id: 'lbbel0',
  617. width: 200,
  618. hidden: ({$Cam['zoom_model']}==2),
  619. html: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}'
  620. },{
  621. xtype: 'combo',
  622. id: 'sens_size',
  623. hidden: ({$Cam['zoom_model']}==2),
  624. fieldLabel: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}',
  625. lazyRender: true,
  626. mode: 'local',
  627. forceSelection: true,
  628. triggerAction: 'all',
  629. editable: false,
  630. disableKeyFilter: true,
  631. store: new Ext.data.ArrayStore({
  632. fields: ['size','size_txt'],
  633. data: [
  634. [0,'1/3.6"'],
  635. [1,'1/3.2"'],
  636. [2,'1/3"'],
  637. [3,'1/2.7"'],
  638. [4,'1/2"'],
  639. [5,'1/1.8"'],
  640. [6,'2/3"'],
  641. [7,'1"'],
  642. [8,'4/3"'],
  643. [9,'APS-C'],
  644. [10,'35 mm'],
  645. [11,'645']
  646. ]
  647. }),
  648. valueField: 'size',
  649. displayField: 'size_txt',
  650. value: {$Cam['imager_type']},
  651. listeners:{
  652. select:function( c, r, i ){
  653. doCamOperation( {$CID}, 2, i );
  654. }
  655. }
  656. },{
  657. id: 'empty0',
  658. hidden: ({$Cam['zoom_model']}==2),
  659. html: '&nbsp;'
  660. },{
  661. id: 'lbbel11',
  662. hidden: ({$Cam['zoom_model']}==2),
  663. html: '{$Labels->GetLabel('_CAM_FOCALL_')}'
  664. },{
  665. xtype: 'combo',
  666. id: 'lens_fl',
  667. hidden: ({$Cam['zoom_model']}==2),
  668. fieldLabel: '{$Labels->GetLabel('_CAM_FOCALL_')}',
  669. lazyRender: true,
  670. mode: 'local',
  671. forceSelection: true,
  672. triggerAction: 'all',
  673. editable: false,
  674. disableKeyFilter: true,
  675. store: new Ext.data.ArrayStore({
  676. fields: ['fl','fl_txt'],
  677. data: [
  678. [0,'2.7 mm.'],
  679. [1,'3.0 mm.'],
  680. [2,'3.2 mm.'],
  681. [3,'3.5 mm.'],
  682. [4,'3.7 mm.'],
  683. [5,'3.9 mm.'],
  684. [6,'4.0 mm.'],
  685. [7,'4.3 mm.'],
  686. [8,'4.8 mm.'],
  687. [9,'5.0 mm.'],
  688. [10,'5.1 mm.'],
  689. [11,'5.5 mm.'],
  690. [12,'5.8 mm.'],
  691. [13,'6.0 mm.'],
  692. [14,'6.2 mm.'],
  693. [15,'6.6 mm.'],
  694. [16,'7.0 mm.'],
  695. [17,'7.1 mm.'],
  696. [18,'7.5 mm.'],
  697. [19,'7.6 mm.'],
  698. [20,'8.0 mm.'],
  699. [21,'8.6 mm.'],
  700. [22,'8.9 mm.'],
  701. [23,'9.0 mm.'],
  702. [24,'9.2 mm.'],
  703. [25,'9.3 mm.'],
  704. [26,'10.0 mm.'],
  705. [27,'10.5 mm.'],
  706. [28,'10.6 mm.'],
  707. [29,'10.7 mm.'],
  708. [30,'11.0 mm.'],
  709. [31,'11.3 mm.'],
  710. [32,'12.0 mm.'],
  711. [33,'12.9 mm.'],
  712. [34,'13.0 mm.'],
  713. [35,'13.5 mm.'],
  714. [36,'13.6 mm.'],
  715. [37,'14.0 mm.'],
  716. [38,'14.6 mm.'],
  717. [39,'15.0 mm.'],
  718. [40,'15.1 mm.'],
  719. [41,'15.5 mm.'],
  720. [42,'16.0 mm.'],
  721. [43,'17.0 mm.'],
  722. [44,'17.5 mm.'],
  723. [44,'17.7 mm.'],
  724. [45,'18.0 mm.'],
  725. [46,'18.2 mm.'],
  726. [47,'19.0 mm.']
  727. ]
  728. }),
  729. valueField: 'fl',
  730. displayField: 'fl_txt',
  731. value: {$Cam['lens_f']},
  732. listeners:{
  733. select:function( c, r, i ){
  734. doCamOperation( {$CID}, 3, i );
  735. }
  736. }
  737. },{
  738. id: 'empty1',
  739. hidden: ({$Cam['zoom_model']}==2),
  740. html: '&nbsp;'
  741. },{
  742. id: 'lbbel1',
  743. hidden: ({$Cam['zoom_model']}!=1),
  744. html: '{$Labels->GetLabel('_CAM_ZOOMR_')}'
  745. },{
  746. xtype: 'slider',
  747. id: 'zoom_val',
  748. hidden: ({$Cam['zoom_model']}!=1),
  749. disabled: ( parseFloat({$Cam['zoom']})==0 ),
  750. minValue: 1.0,
  751. maxValue: 140.0,
  752. value: {$Cam['zoom']},
  753. listeners:{
  754. change: function( a, c, b ){
  755. doCamOperation( {$CID}, 4, c );
  756. var zz = Ext.getCmp('zoom_d');
  757. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  758. }
  759. }
  760. },{
  761. id: 'zoom_d',
  762. hidden: ({$Cam['zoom_model']}!=1),
  763. html: (( parseFloat({$Cam['zoom']})==0 )?'&nbsp;':'<p>X&nbsp;'+ {$Cam['zoom']} + '</p>' )
  764. },{
  765. id: 'lbbel3',
  766. hidden: ({$Cam['zoom_model']}!=2),
  767. html: '{$Labels->GetLabel('_CAM_MAX_RANGE_')}'
  768. },{
  769. xtype: 'numberfield',
  770. id: 'zoom_range1',
  771. width: 240,
  772. hidden: ({$Cam['zoom_model']}!=2),
  773. value: {$Cam['max_range']},
  774. listeners:{
  775. change: function( a, c, b ){
  776. doCamOperation( {$CID}, 22, c );
  777. }
  778. }
  779. },{
  780. id: 'empup_2',
  781. hidden: ({$Cam['zoom_model']}!=2),
  782. html: '{$Labels->GetLabel('_METERS_')}'
  783. },{
  784. id: 'lbbel4',
  785. hidden: ({$Cam['zoom_model']}!=2),
  786. html: ''
  787. },{
  788. id: 'zoom_perc1',
  789. width: 240,
  790. hidden: ({$Cam['zoom_model']}!=2),
  791. html: '<center><p>'+ {$Cam['zoom']} + '%</p></center>'
  792. },{
  793. id: 'empup_3',
  794. hidden: ({$Cam['zoom_model']}!=2),
  795. html: ''
  796. },{
  797. id: 'lbbel2',
  798. hidden: ({$Cam['zoom_model']}!=2),
  799. style: {
  800. marginLeft: '120px' //https://www.biostar.com.tw/app/en/eol/introduction.php?S_ID=711
  801. },
  802. html: '<img width="32px" src="/style/wicons/wide.png"/>'
  803. },{
  804. xtype: 'slider',
  805. id: 'zoom_val2',
  806. hidden: ({$Cam['zoom_model']}!=2),
  807. minValue: 1.0,
  808. maxValue: 100.0,
  809. value: {$Cam['zoom']},
  810. listeners:{
  811. change: function( a, c, b ){
  812. doCamOperation( {$CID}, 23, c );
  813. var zz = Ext.getCmp('zoom_perc1');
  814. if( zz.rendered ) zz.update('<center><p>'+ c + '%</p></center>');
  815. }
  816. }
  817. },{
  818. id: 'zoom_d2',
  819. hidden: ({$Cam['zoom_model']}!=2),
  820. html: '<img width="32px" src="/style/wicons/narrow.png"/>'
  821. }]
  822. }]
  823. },{
  824. title: '{$Labels->GetLabel('_PTZ_TAB_')}',
  825. id: 'ptz_tab',
  826. frame: false,
  827. border: false,
  828. items:[{
  829. layout: 'table',
  830. frame: false,
  831. border: false,
  832. layoutConfig: {
  833. columns: 3
  834. },
  835. defaults: {
  836. frame: false,
  837. bodyStyle: 'padding:10px',
  838. border: false
  839. },
  840. items:[{
  841. width: 200,
  842. html: '{$Labels->GetLabel('__PTZ_CONTROL__')}'
  843. },{
  844. xtype: 'combo',
  845. fieldLabel: '{$Labels->GetLabel('__PTZ_CONTROL__')}',
  846. lazyRender: true,
  847. id: 'ptz_proto',
  848. mode: 'local',
  849. forceSelection: true,
  850. triggerAction: 'all',
  851. editable: false,
  852. disableKeyFilter: true,
  853. store: new Ext.data.ArrayStore({
  854. fields: ['type','type_txt'],
  855. data: [
  856. [0,'{$Labels->GetLabel('_NO_PTZ_')}'],
  857. [1,'Sony VISCA'],
  858. [2,'Pelco-D'],
  859. [3,'OnVif'],
  860. [4,'PSIA'],
  861. [5,'GB/T28181']
  862. ]
  863. }),
  864. value: {$Cam['protocol']},
  865. valueField: 'type',
  866. displayField: 'type_txt',
  867. listeners:{
  868. select: function( a, c, b ){
  869. doCamOperation( {$CID}, 5, b );
  870. if( b > 0 ){
  871. Ext.getCmp('cam_drive_par').show();
  872. if(({$Cam['type']}==13)||({$Cam['type']}==11)){
  873. Ext.getCmp('cam_ptz_par').show();
  874. } else {
  875. Ext.getCmp('cam_ptz_par').hide();
  876. };
  877. if( b == 1 || b == 2 ){
  878. Ext.getCmp('cam_uart_par').show();
  879. Ext.getCmp('uart_id').enable();
  880. Ext.getCmp('prot_id').enable();
  881. } else {
  882. Ext.getCmp('cam_uart_par').hide();
  883. Ext.getCmp('uart_id').disable();
  884. Ext.getCmp('prot_id').disable();
  885. };
  886. Ext.getCmp('pan_mode').enable();
  887. Ext.getCmp('tilt_mode').enable();
  888. Ext.getCmp('pan_ang').enable();
  889. Ext.getCmp('tilt_ang').enable();
  890. } else {
  891. Ext.getCmp('cam_ptz_par').hide();
  892. Ext.getCmp('cam_drive_par').hide();
  893. Ext.getCmp('cam_uart_par').hide();
  894. Ext.getCmp('uart_id').disable();
  895. Ext.getCmp('prot_id').disable();
  896. Ext.getCmp('pan_mode').disable();
  897. Ext.getCmp('tilt_mode').disable();
  898. Ext.getCmp('pan_ang').disable();
  899. Ext.getCmp('tilt_ang').disable();
  900. };
  901. }
  902. }
  903. },{
  904. html: '&nbsp;'
  905. }]
  906. },{
  907. layout: 'table',
  908. id: 'cam_uart_par',
  909. frame: false,
  910. border: false,
  911. hidden: (({$Cam['protocol']}!=1) || ({$Cam['protocol']}!=2)),
  912. layoutConfig: {
  913. columns: 3
  914. },
  915. defaults: {
  916. frame: false,
  917. bodyStyle: 'padding:10px',
  918. border: false
  919. },
  920. items:[{
  921. width: 200,
  922. html: '{$Labels->GetLabel('_UART_PORT_')}'
  923. },{
  924. xtype: 'combo',
  925. fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}',
  926. lazyRender: true,
  927. id: 'uart_id',
  928. mode: 'local',
  929. forceSelection: true,
  930. triggerAction: 'all',
  931. editable: false,
  932. disableKeyFilter: true,
  933. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  934. store: new Ext.data.ArrayStore({
  935. fields: ['uart','uart_txt'],
  936. data: [{$UARTS}]
  937. }),
  938. valueField: 'uart',
  939. displayField: 'uart_txt',
  940. value: {$Cam['uart_id']},
  941. listeners:{
  942. select: function( a, c, b ){
  943. doCamOperation( {$CID}, 6, b );
  944. }
  945. }
  946. },{
  947. html: '&nbsp;'
  948. },{
  949. html: '{$Labels->GetLabel('_CAM_PROTO_ID_')}'
  950. },{
  951. xtype: 'numberfield',
  952. id: 'prot_id',
  953. width: '95%',
  954. disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  955. minValue: 0,
  956. maxValue: 255,
  957. value: {$Cam['protocol_aux']},
  958. listeners:{
  959. change: function( a, c, b ){
  960. doCamOperation( {$CID}, 7, c );
  961. }
  962. }
  963. },{
  964. html: '&nbsp;'
  965. }]
  966. },{
  967. layout: 'table',
  968. id: 'cam_drive_par',
  969. frame: false,
  970. border: false,
  971. hidden: ({$Cam['protocol']}<1),
  972. layoutConfig: {
  973. columns: 3
  974. },
  975. defaults: {
  976. frame: false,
  977. bodyStyle: 'padding:10px',
  978. border: false
  979. },
  980. items:[{
  981. width: 200,
  982. html: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}'
  983. },{
  984. xtype: 'combo',
  985. fieldLabel: '{$Labels->GetLabel('_CAM_PTZ_MODE_')}',
  986. lazyRender: true,
  987. id: 'cam_ptz_mode',
  988. mode: 'local',
  989. forceSelection: true,
  990. triggerAction: 'all',
  991. editable: false,
  992. disableKeyFilter: true,
  993. store: new Ext.data.ArrayStore({
  994. fields: ['momo','momo_txt'],
  995. data: [[0,'Absolute'],[1,'Presetets']]
  996. }),
  997. valueField: 'momo',
  998. displayField: 'momo_txt',
  999. value: ((({$Cam['type']}==13)||({$Cam['type']}==11))?0:1),
  1000. listeners:{
  1001. select: function( a, c, b ){
  1002. doCamOperation( {$CID}, 27, b );
  1003. if( b == 1 ){
  1004. Ext.getCmp('cam_ed_preset').enable();
  1005. Ext.getCmp('cam_ptz_par').hide();
  1006. } else {
  1007. Ext.getCmp('cam_ed_preset').disable();
  1008. Ext.getCmp('cam_ptz_par').show();
  1009. };
  1010. }
  1011. }
  1012. },{
  1013. xtype: 'button',
  1014. id: 'cam_ed_preset',
  1015. //disabled: (({$Cam['type']}==13)||({$Cam['type']}==11)),
  1016. text: '{$Labels->GetLabel('_CAM_PRES_EDIT_')}',
  1017. handler: function(){
  1018. var zaza = new Ext.Window({
  1019. title: '{$Labels->GetLabel('_CAM_PRES_EDITOR_')}',
  1020. modal: true,
  1021. resizable: false,
  1022. width: 800,
  1023. height: 804,
  1024. sukaMineWidth: -1,
  1025. items:[{
  1026. id: 'db_node_{$Node['id']}_pic',
  1027. border: true,
  1028. width: '100%',
  1029. 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>'
  1030. },{
  1031. layout: 'table',
  1032. layoutConfig: {
  1033. columns: 3
  1034. },
  1035. defaults: {
  1036. frame: false,
  1037. bodyStyle: 'padding:10px',
  1038. border: false
  1039. },
  1040. items:[{
  1041. width: 200,
  1042. html: '{$Labels->GetLabel('_CAM_PRES_SSELECT_')}'
  1043. },{
  1044. xtype: 'combo',
  1045. lazyRender: true,
  1046. id: 'sensor_id',
  1047. mode: 'local',
  1048. forceSelection: true,
  1049. triggerAction: 'all',
  1050. editable: false,
  1051. disableKeyFilter: true,
  1052. //disabled: (({$Cam['protocol']}!=1 ) && ( {$Cam['protocol']}!=2 )),
  1053. store: new Ext.data.ArrayStore({
  1054. fields: ['sens','sens_txt'],
  1055. data: {$SENSORS}
  1056. }),
  1057. valueField: 'sens',
  1058. displayField: 'sens_txt',
  1059. value: {$SENSOID},
  1060. listeners:{
  1061. select: function( a, c, b ){
  1062. selectedPresetsBackgroundSensor = c.data.sens;
  1063. }
  1064. }
  1065. },{
  1066. xtype: 'button',
  1067. text: '{$Labels->GetLabel('_CAM_PRES_LOBACK_')}',
  1068. width: 240,
  1069. handler: function(){
  1070. if( selectedPresetsBackgroundSensor == 0 ){
  1071. selectedPresetsBackgroundSensor = Ext.getCmp( 'sensor_id' ).getValue();
  1072. //selectedPresetsBackgroundSensor = {$SENSOID};
  1073. };
  1074. if( selectedPresetsBackgroundSensor ) preview2DDraw( selectedPresetsBackgroundSensor, 'ptz_presets_');
  1075. }
  1076. },{
  1077. html: ''
  1078. },{
  1079. xtype: 'button',
  1080. text: '{$Labels->GetLabel('_CAM_PRES_DELALL_')}',
  1081. width: 230,
  1082. handler: function(){
  1083. doCamOperation( {$CID}, 34, 0 );
  1084. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 1000 );
  1085. }
  1086. },{
  1087. xtype: 'button',
  1088. text: '{$Labels->GetLabel('_CAM_PRES_REMBG_')}',
  1089. width: 240,
  1090. handler: function(){
  1091. selectedPresetsBackgroundSensor = 0;
  1092. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1093. }
  1094. },{
  1095. html: '{$Labels->GetLabel('_CAM_PRES_COUNT_')}'
  1096. },{
  1097. xtype: 'numberfield',
  1098. id: 'pres_count',
  1099. width: 240
  1100. },{
  1101. xtype: 'button',
  1102. text: 'Set',
  1103. width: 240,
  1104. handler: function(){
  1105. var vv = Ext.getCmp('pres_count').getValue();
  1106. if( vv ){
  1107. doCamOperation( {$CID}, 31, vv );
  1108. };
  1109. }
  1110. },{
  1111. html: '{$Labels->GetLabel('_CAM_PRES_COLS_')}'
  1112. },{
  1113. xtype: 'numberfield',
  1114. id: 'pres_p_seg',
  1115. width: 240
  1116. },{
  1117. xtype: 'button',
  1118. text: '{$Labels->GetLabel('__SET__')}',
  1119. width: 240,
  1120. handler: function(){
  1121. var vv = Ext.getCmp('pres_p_seg').getValue();
  1122. if( vv ){
  1123. doCamOperation( {$CID}, 32, vv );
  1124. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1125. };
  1126. }
  1127. },{
  1128. html: '{$Labels->GetLabel('_CAM_PRES_ROWS_')}'
  1129. },{
  1130. xtype: 'numberfield',
  1131. id: 'pres_z_seg',
  1132. width: 240
  1133. },{
  1134. xtype: 'button',
  1135. text: '{$Labels->GetLabel('__SET__')}',
  1136. width: 240,
  1137. handler: function(){
  1138. var vv = Ext.getCmp('pres_z_seg').getValue();
  1139. if( vv ){
  1140. doCamOperation( {$CID}, 33, vv );
  1141. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+{$Cam['id']}+" );", 300 );
  1142. };
  1143. }
  1144. },{
  1145. html: '{$Labels->GetLabel('_CAM_PRES_IROFF_')}'
  1146. },{
  1147. xtype: 'numberfield',
  1148. id: 'pres_iroff',
  1149. width: 240
  1150. },{
  1151. xtype: 'button',
  1152. text: '{$Labels->GetLabel('__SET__')}',
  1153. width: 240,
  1154. handler: function(){
  1155. var vv = Ext.getCmp('pres_iroff').getValue();
  1156. doCamOperation( {$CID}, 35, vv );
  1157. }
  1158. },{
  1159. html: '{$Labels->GetLabel('_CAM_PRES_IRON_')}'
  1160. },{
  1161. xtype: 'numberfield',
  1162. id: 'pres_iron',
  1163. width: 240
  1164. },{
  1165. xtype: 'button',
  1166. text: '{$Labels->GetLabel('__SET__')}',
  1167. width: 240,
  1168. handler: function(){
  1169. var vv = Ext.getCmp('pres_iron').getValue();
  1170. doCamOperation( {$CID}, 36, vv );
  1171. }
  1172. },{
  1173. html: '{$Labels->GetLabel('_CAM_PRES_IRAUTO_')}'
  1174. },{
  1175. xtype: 'numberfield',
  1176. id: 'pres_irauto',
  1177. width: 240
  1178. },{
  1179. xtype: 'button',
  1180. text: '{$Labels->GetLabel('__SET__')}',
  1181. width: 240,
  1182. handler: function(){
  1183. var vv = Ext.getCmp('pres_irauto').getValue();
  1184. doCamOperation( {$CID}, 37, vv );
  1185. }
  1186. },{
  1187. html: '{$Labels->GetLabel('_CAM_PRES_IRWIPER_')}'
  1188. },{
  1189. xtype: 'numberfield',
  1190. id: 'pres_wiper',
  1191. width: 240
  1192. },{
  1193. xtype: 'button',
  1194. text: '{$Labels->GetLabel('__SET__')}',
  1195. width: 240,
  1196. handler: function(){
  1197. var vv = Ext.getCmp('pres_wiper').getValue();
  1198. doCamOperation( {$CID}, 38, vv );
  1199. }
  1200. }]
  1201. }],
  1202. listeners:{
  1203. resize: function( p, adjWidth, adjHeight, rawWidth, rawHeight ){
  1204. if( rawWidth!= undefined ){
  1205. if( p.sukaMineWidth != adjWidth ){
  1206. p.sukaMineWidth = adjWidth;
  1207. var XX = p.sukaMineWidth * 9 / 16;
  1208. //p.setHeight( XX + 32 );
  1209. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1210. z.setHeight( XX );
  1211. };
  1212. };
  1213. },
  1214. afterrender: function( p ){
  1215. var xx = p.getWidth() * 9 / 16;
  1216. //p.setHeight( xx + 32 );
  1217. var z = Ext.getCmp('db_node_{$Node['id']}_pic');
  1218. z.setHeight( xx );
  1219. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1220. document.getElementById('img_btn_010_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1221. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1222. document.getElementById('img_btn_011_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1223. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1224. document.getElementById('img_btn_027_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1225. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1226. document.getElementById('img_btn_028_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1227. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1228. document.getElementById('img_btn_029_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1229. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1230. document.getElementById('img_btn_030_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1231. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1232. document.getElementById('img_btn_031_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1233. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1234. document.getElementById('img_btn_032_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1235. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1236. document.getElementById('img_btn_033_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1237. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mouseup', makePtzStop );
  1238. document.getElementById('img_btn_034_{$Node['id']}').addEventListener( 'mousedown', makePtzMove );
  1239. document.getElementById('img_btn_020_{$Node['id']}').addEventListener( 'mousedown', makePtzStop );
  1240. showCameraPresets( 'ptz_presets_0', {$Cam['id']} );
  1241. }
  1242. }
  1243. });
  1244. zaza.show();
  1245. }
  1246. },{
  1247. html: '{$Labels->GetLabel('_CAM_IR_ECO_')}'
  1248. },{
  1249. xtype: 'checkbox',
  1250. id: 'ptz_ir_eco',
  1251. checked: ({$Cam['eco_ir']} > 0 ),
  1252. listeners:{
  1253. check: function( a, c ){
  1254. if( c ){
  1255. doCamOperation( {$CID}, 39, 1 );
  1256. } else {
  1257. doCamOperation( {$CID}, 39, 0 );
  1258. };
  1259. }
  1260. }
  1261. },{
  1262. html: '&nbsp;'
  1263. },{
  1264. html: '{$Labels->GetLabel('_CAM_PTZ_AAC_')}'
  1265. },{
  1266. xtype: 'checkbox',
  1267. id: 'ptz_axel_c',
  1268. disabled: ({$Cam['protocol']} == 0),
  1269. checked: ({$Cam['ptz_axel']} < 6 ),
  1270. listeners:{
  1271. check: function( a, c ){
  1272. if( c ){
  1273. doCamOperation( {$CID}, 13, 0 );
  1274. var zz = Ext.getCmp('ptz_axel');
  1275. zz.disable();
  1276. } else {
  1277. var zz = Ext.getCmp('ptz_axel');
  1278. zz.enable();
  1279. var vava = zz.getValue();
  1280. if( vava < 5 ){
  1281. vava = 5;
  1282. zz.setValue( vava, true );
  1283. } else {
  1284. doCamOperation( {$CID}, 13, vava );
  1285. };
  1286. var jj = Ext.getCmp('ptz_axel_d');
  1287. if( jj.rendered ) jj.update('<p>X&nbsp;'+ vava + '</p>');
  1288. };
  1289. }
  1290. }
  1291. },{
  1292. html: '&nbsp;'
  1293. },{
  1294. html: '{$Labels->GetLabel('_CAM_PTZ_MAC_')}'
  1295. },{
  1296. xtype: 'slider',
  1297. id: 'ptz_axel',
  1298. disabled: (({$Cam['protocol']} == 0)||({$Cam['ptz_axel']} < 6)),
  1299. minValue: 5,
  1300. maxValue: 20,
  1301. value: {$Cam['ptz_axel']},
  1302. listeners:{
  1303. change: function( a, c, b ){
  1304. doCamOperation( {$CID}, 13, c );
  1305. var zz = Ext.getCmp('ptz_axel_d');
  1306. if( zz.rendered ) zz.update('<p>X&nbsp;'+ c + '</p>');
  1307. }
  1308. }
  1309. },{
  1310. id: 'ptz_axel_d',
  1311. html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
  1312. }]
  1313. },{
  1314. layout: 'table',
  1315. id: 'cam_ptz_par',
  1316. hidden: (({$Cam['protocol']}<1) || ({$Cam['type']}>13)),
  1317. frame: false,
  1318. border: false,
  1319. layoutConfig: {
  1320. columns: 3
  1321. },
  1322. defaults: {
  1323. frame: false,
  1324. bodyStyle: 'padding:10px',
  1325. border: false
  1326. },
  1327. items:[{
  1328. width: 200,
  1329. html: '{$Labels->GetLabel('_CAM_PANMOD_')}'
  1330. },{
  1331. xtype: 'combo',
  1332. fieldLabel: '{$Labels->GetLabel('_CAM_PANMOD_')}',
  1333. lazyRender: true,
  1334. id: 'pan_mode',
  1335. disabled: ({$Cam['protocol']} == 0),
  1336. mode: 'local',
  1337. forceSelection: true,
  1338. triggerAction: 'all',
  1339. editable: false,
  1340. disableKeyFilter: true,
  1341. store: new Ext.data.ArrayStore({
  1342. fields: ['pm','pm_txt'],
  1343. data: [
  1344. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1345. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}']
  1346. ]
  1347. }),
  1348. valueField: 'pm',
  1349. displayField: 'pm_txt',
  1350. value: {$Cam['pan_model']},
  1351. listeners:{
  1352. select: function( a, c, b ){
  1353. doCamOperation( {$CID}, 8, b );
  1354. }
  1355. }
  1356. },{
  1357. html: '&nbsp;'
  1358. },{
  1359. html: '{$Labels->GetLabel('_CAM_PANANGS_')}'
  1360. },{
  1361. xtype: 'numberfield',
  1362. id: 'pan_ang',
  1363. width: '95%',
  1364. disabled: ({$Cam['protocol']} == 0),
  1365. minValue: 0,
  1366. maxValue: 360,
  1367. value: {$Cam['pan_angles']},
  1368. listeners:{
  1369. change: function( a, c, b ){
  1370. doCamOperation( {$CID}, 9, c );
  1371. }
  1372. }
  1373. },{
  1374. html: '&nbsp;'
  1375. },{
  1376. html: '{$Labels->GetLabel('_CAM_TILTMOD_')}'
  1377. },{
  1378. xtype: 'combo',
  1379. fieldLabel: '{$Labels->GetLabel('_CAM_TILTMOD_')}',
  1380. lazyRender: true,
  1381. id: 'tilt_mode',
  1382. disabled: ({$Cam['protocol']} == 0),
  1383. mode: 'local',
  1384. forceSelection: true,
  1385. triggerAction: 'all',
  1386. editable: false,
  1387. disableKeyFilter: true,
  1388. store: new Ext.data.ArrayStore({
  1389. fields: ['tm','tm_txt'],
  1390. data: [
  1391. [0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
  1392. [1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}'],
  1393. [2,'{$Labels->GetLabel('_CAM_TM_SHIFTED_')} 90�'],
  1394. [3,'{$Labels->GetLabel('_CAM_TM_RSHIFTED_')} 90�']
  1395. ]
  1396. }),
  1397. valueField: 'tm',
  1398. displayField: 'tm_txt',
  1399. value: {$Cam['tilt_model']},
  1400. listeners:{
  1401. select: function( a, c, b ){
  1402. doCamOperation( {$CID}, 10, b );
  1403. }
  1404. }
  1405. },{
  1406. html: '&nbsp;'
  1407. },{
  1408. html: '{$Labels->GetLabel('_CAM_TILTANGS_')}'
  1409. },{
  1410. xtype: 'numberfield',
  1411. id: 'tilt_ang',
  1412. width: '95%',
  1413. disabled: ({$Cam['protocol']} == 0),
  1414. minValue: 0,
  1415. maxValue: 180,
  1416. value: {$Cam['tilt_angles']},
  1417. listeners:{
  1418. change: function( a, c, b ){
  1419. doCamOperation( {$CID}, 11, c );
  1420. }
  1421. }
  1422. },{
  1423. html: '&nbsp;'
  1424. }]
  1425. },{
  1426. layout: 'table',
  1427. id: 'cam_loc_ori',
  1428. frame: false,
  1429. border: false,
  1430. layoutConfig: {
  1431. columns: 3
  1432. },
  1433. defaults: {
  1434. frame: false,
  1435. bodyStyle: 'padding:10px',
  1436. border: false
  1437. },
  1438. items:[{
  1439. width: 200,
  1440. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
  1441. },{
  1442. xtype: 'numberfield',
  1443. decimalPrecision: 3,
  1444. value: {$Cam['x_rot']},
  1445. listeners:{
  1446. change: function( a, c, b ){
  1447. doCamOperation( {$CID}, 14, c );
  1448. }
  1449. }
  1450. },{
  1451. html: '&nbsp;'
  1452. },{
  1453. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
  1454. },{
  1455. xtype: 'numberfield',
  1456. decimalPrecision: 3,
  1457. value: {$Cam['y_rot']},
  1458. listeners:{
  1459. change: function( a, c, b ){
  1460. doCamOperation( {$CID}, 15, c );
  1461. }
  1462. }
  1463. },{
  1464. html: '&nbsp;'
  1465. },{
  1466. html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
  1467. },{
  1468. xtype: 'numberfield',
  1469. decimalPrecision: 3,
  1470. value: {$Cam['z_rot']},
  1471. listeners:{
  1472. change: function( a, c, b ){
  1473. doCamOperation( {$CID}, 16, c );
  1474. }
  1475. }
  1476. },{
  1477. html: '&nbsp;'
  1478. },{
  1479. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
  1480. },{
  1481. xtype: 'numberfield',
  1482. decimalPrecision: 3,
  1483. value: {$Cam['x']},
  1484. listeners:{
  1485. change: function( a, c, b ){
  1486. doCamOperation( {$CID}, 17, c );
  1487. }
  1488. }
  1489. },{
  1490. html: '&nbsp;'
  1491. },{
  1492. html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
  1493. },{
  1494. xtype: 'numberfield',
  1495. decimalPrecision: 3,
  1496. value: {$Cam['y']},
  1497. listeners:{
  1498. change: function( a, c, b ){
  1499. doCamOperation( {$CID}, 18, 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-z-512.png"></td></tr></table>'
  1506. },{
  1507. xtype: 'numberfield',
  1508. decimalPrecision: 3,
  1509. value: {$Cam['z']},
  1510. listeners:{
  1511. change: function( a, c, b ){
  1512. doCamOperation( {$CID}, 19, c );
  1513. }
  1514. }
  1515. },{
  1516. html: '&nbsp;'
  1517. }]
  1518. }]
  1519. },{
  1520. title: '{$Labels->GetLabel('_TARGETING_TAB_')}',
  1521. id: 'target_tab',
  1522. frame: false,
  1523. border: false,
  1524. items:[{
  1525. layout: 'table',
  1526. frame: false,
  1527. border: false,
  1528. layoutConfig: {
  1529. columns: 3
  1530. },
  1531. defaults: {
  1532. frame: false,
  1533. bodyStyle: 'padding:10px',
  1534. border: false
  1535. },
  1536. items:[{
  1537. width: 200,
  1538. html: '{$Labels->GetLabel('_CAM_LABEL_')}'
  1539. },{
  1540. xtype: 'textfield',
  1541. id: 'cam_label',
  1542. width: 200,
  1543. value: '{$Cam['node_name']}',
  1544. listeners:{
  1545. change: function( a, c, b ){
  1546. doCamOperation( {$CID}, 20, c );
  1547. }
  1548. }
  1549. },{
  1550. xtype: 'spacer'
  1551. },{
  1552. width: 200,
  1553. html: '{$Labels->GetLabel('_CAM_TRIGGERING_MODE_')}'
  1554. },{
  1555. xtype: 'combo',
  1556. lazyRender: true,
  1557. id: 'cam_targeting',
  1558. mode: 'local',
  1559. forceSelection: true,
  1560. triggerAction: 'all',
  1561. editable: false,
  1562. disableKeyFilter: true,
  1563. store: new Ext.data.ArrayStore({
  1564. fields: ['type','type_txt'],
  1565. data: [
  1566. [0,'{$Labels->GetLabel('_CAM_TM_STRICT_VISIBLE_')}'],
  1567. [1,'{$Labels->GetLabel('_CAM_TM_ALL_NEAR_')}'],
  1568. [2,'{$Labels->GetLabel('_CAM_TM_ALL_FAR_')}'],
  1569. [3,'{$Labels->GetLabel('_CAM_TM_ALL_')}']
  1570. ]
  1571. }),
  1572. value: {$Cam['trigger_mode']},
  1573. valueField: 'type',
  1574. displayField: 'type_txt',
  1575. listeners:{
  1576. select: function( a, c, b ){
  1577. doCamOperation( {$CID}, 12, b );
  1578. }
  1579. }
  1580. },{
  1581. xtype: 'spacer'
  1582. },{
  1583. width: 200,
  1584. html: '{$Labels->GetLabel('_CAM_PREF_ONLY_')}'
  1585. },{
  1586. xtype: 'checkbox',
  1587. id: 'cam_pref_only',
  1588. fieldLabel: '',
  1589. width: 200,
  1590. checked: {$Cam['prefered_events_only']},
  1591. listeners:{
  1592. check: function( a, c ){
  1593. if( c ){
  1594. doCamOperation( {$CID}, 40, 1 );
  1595. } else {
  1596. doCamOperation( {$CID}, 40, 0 );
  1597. };
  1598. }
  1599. }
  1600. },{
  1601. xtype: 'spacer'
  1602. },{
  1603. width: 200,
  1604. html: '{$Labels->GetLabel('_CAM_AUTO_HOMING_')}'
  1605. },{
  1606. xtype: 'checkbox',
  1607. id: 'cam_horeten',
  1608. fieldLabel: '',
  1609. width: 200,
  1610. checked: {$Cam['homing_enable']},
  1611. listeners:{
  1612. check: function( a, c ){
  1613. if( c ){
  1614. doCamOperation( {$CID}, 25, 1 );
  1615. } else {
  1616. doCamOperation( {$CID}, 25, 0 );
  1617. };
  1618. }
  1619. }
  1620. },{
  1621. xtype: 'spacer'
  1622. },{
  1623. width: 200,
  1624. html: '{$Labels->GetLabel('_CAM_AH_TIME_')}'
  1625. },{
  1626. xtype: 'numberfield',
  1627. id: 'cam_horetto',
  1628. width: 200,
  1629. value: '{$Cam['homing_to']}',
  1630. listeners:{
  1631. change: function( a, c, b ){
  1632. doCamOperation( {$CID}, 26, c );
  1633. }
  1634. }
  1635. },{
  1636. xtype: 'spacer'
  1637. },{
  1638. width: 200,
  1639. html: '{$Labels->GetLabel('_CAM_AH_TOKEN_')}'
  1640. },{
  1641. xtype: 'textfield',
  1642. id: 'cam_horettk',
  1643. fieldLabel: '',
  1644. width: 200,
  1645. value: '{$Cam['home_token']}',
  1646. readOnly: true
  1647. },{
  1648. xtype: 'spacer'
  1649. }]
  1650. }]
  1651. }]
  1652. }
  1653. PZAKSJEJSDKGJHGASD;
  1654. $Data['status']='ok';
  1655. if( $Cam['status'] == 0 ){
  1656. $ADDCAMPOPO = '';
  1657. } else {
  1658. $ADDCAMPOPO = '';
  1659. };
  1660. if( $CAM_IP ){
  1661. switch( $Cam['status'] ){
  1662. case 0: $Data['content'] = $TPL_SET_CREDS_IP; break;
  1663. default: $Data['content'] = $TPL_CAM_EDITOR; break;
  1664. };
  1665. } else {
  1666. $Data['content'] = $TPL_CAM_EDITOR;
  1667. };
  1668. } else {
  1669. $Data['status']='error';
  1670. };
  1671. echo $Data['content'];
  1672. } else {
  1673. header('location: /');
  1674. };
  1675. ?>